4.9 Continuous functions: three big theorems

Let aa, bb\in\mathbb{R} with a<ba<b so that [a,b][a,b] is a closed, bounded interval. Here we study continuous functions f:[a,b]f\colon[a,b]\to\mathbb{R} and show that they have a number of special properties. These properties are described by three big theorems:

  • Intermediate value theorem;

  • Boundedness theorem;

  • Extreme value theorem.

The intermediate value theorem

Let aa, bb\in\mathbb{R} with a<ba<b and suppose f:[a,b]f\colon[a,b]\to\mathbb{R} is continuous and satisfies f(a)<f(b)f(a)<f(b). As illustrated in Figure 4.23, we can think of the graph of ff as a continuous path starting at (a,f(a))(a,f(a)) and ending at (b,f(b))(b,f(b)). Now chose some ‘intermediate value’ f(a)<y0<f(b)f(a)<y_{0}<f(b) along the yy-axis. We draw the horizontal straight line y=y0y=y_{0}, which separates the points (a,f(a))(a,f(a)) and (b,f(b))(b,f(b)). It is intuitively clear that the path traced out by the graph of ff must cross the line y=y0y=y_{0} at some point. That is, there must exist some x0[a,b]x_{0}\in[a,b] such that f(x0)=y0f(x_{0})=y_{0}. This simple intuition is made precise by the intermediate value theorem.

Figure 4.23: The intermediate value theorem. For f:[a,b]f\colon[a,b]\to\mathbb{R} continuous, given f(a)y0f(b)f(a)\leq y_{0}\leq f(b), there exists some x0[a,b]x_{0}\in[a,b] such that f(x0)=y0f(x_{0})=y_{0}.
Theorem 4.91 (Intermediate value theorem).

Let aa, bb\in\mathbb{R} with a<ba<b and suppose f:[a,b]f\colon[a,b]\to\mathbb{R} is continuous with f(a)f(b)f(a)\leq f(b). For all y0y_{0}\in\mathbb{R} such that f(a)y0f(b)f(a)\leq y_{0}\leq f(b), there exists some x0[a,b]x_{0}\in[a,b] such that f(x0)=y0f(x_{0})=y_{0}.

From the sketch in Figure 4.23, the idea behind the intermediate value theorem is intuitively clear. However, it is in fact a deep result which relies on the completeness axiom. To see this is the case, the following example shows how the theorem implies the existence of numbers such as 2\sqrt{2} which are missing from \mathbb{Q} (recall from Chapter 1 that the existence of these numbers relies on the completeness axiom).

Example 4.92.

We can use the intermediate value theorem to give another proof of the existence of 2\sqrt{2}. Consider the function p2:[0,2][0,4]p_{2}\colon[0,2]\to[0,4] given by p2(x):=x2p_{2}(x):=x^{2} for all x[0,2]x\in[0,2]. Then p2p_{2} is continuous and satisfies p2(0)=0<2<4=p2(2)p_{2}(0)=0<2<4=p_{2}(2). Hence, by the intermediate value theorem, we see that there exists some s[0,2]s\in[0,2] such that p2(s)=2p_{2}(s)=2. In other words, s2=2s^{2}=2 so that s=2s=\sqrt{2}.

Exercise 4.93.

Use the intermediate value theorem to show the following.

  1. (i)

    For all x00x_{0}\geq 0 there exists some s0s\geq 0 such that s2=x0s^{2}=x_{0}.

  2. (ii)

    More generally, for all x00x_{0}\geq 0 and all nn\in\mathbb{N} there exists some s0s\geq 0 such that sn=x0s^{n}=x_{0}.

In order to prove Theorem 4.91, we shall make use of the following simple lemma, which exploits the continuity hypothesis.

Lemma 4.94.

Let II\subseteq\mathbb{R} be an interval, f:If\colon I\to\mathbb{R} be continuous at x0Ix_{0}\in I and y0y_{0}\in\mathbb{R}.

  1. (a)

    If f(x0)>y0f(x_{0})>y_{0}, then there exists some δ>0\delta>0 such that for all xIx\in I with |xx0|<δ|x-x_{0}|<\delta, we have f(x)>y0f(x)>y_{0}.

  2. (b)

    If f(x0)<y0f(x_{0})<y_{0}, then there exists some δ>0\delta>0 such that for all xIx\in I with |xx0|<δ|x-x_{0}|<\delta, we have f(x)<y0f(x)<y_{0}.

Figure 4.24: Illustration of the proof of Lemma 4.94 (a).
Proof.

We shall only prove part (a); part (b) follows either by a similar argument or by reflection (replacing ff with f-f).

Since f(x0)>y0f(x_{0})>y_{0}, we have

ε:=f(x0)y0>0.\varepsilon:=f(x_{0})-y_{0}>0.

Applying the ε\varepsilon-δ\delta definition of continuity with this value of ε\varepsilon, there exists some δ>0\delta>0 such that for all xIx\in I with |xx0|<δ|x-x_{0}|<\delta we have

|f(x)f(x0)|<ε.|f(x)-f(x_{0})|<\varepsilon.

Observe that

f(x)=f(x0)(f(x)f(x0))f(x0)|f(x)f(x0)|.f(x)=f(x_{0})-(f(x)-f(x_{0}))\geq f(x_{0})-|f(x)-f(x_{0})|.

Therefore, for all xIx\in I with |xx0|<δ|x-x_{0}|<\delta, we have

f(x)>f(x0)ε=f(x0)(f(x0)y0)=y0f(x)>f(x_{0})-\varepsilon=f(x_{0})-(f(x_{0})-y_{0})=y_{0}

as required. ∎

Proof (of Theorem 4.91).

We may assume f(a)<y0<f(b)f(a)<y_{0}<f(b), since otherwise we can take x0x_{0} to be either aa or bb.

Consider the set

E:={x[a,b]:f(x)<y0}.E:=\big{\{}x\in[a,b]:f(x)<y_{0}\big{\}}.

We illustrate this set in Figure 4.25.

Figure 4.25: The set E:={x[a,b]:f(x)<y0}E:=\big{\{}x\in[a,b]:f(x)<y_{0}\big{\}} and x0:=supEx_{0}:=\sup E from the proof of the intermediate value theorem, drawn along the xx-axis.

Since we assumed y0>f(a)y_{0}>f(a), it follows that aEa\in E and so EE is nonempty. On the other hand, xbx\leq b for all xEx\in E so that bb is an upper bound for the set EE. Hence, EE is nonempty and bounded above, so x0:=supEx_{0}:=\sup E exists by the completeness axiom and x0[a,b]x_{0}\in[a,b].

Intuitively, it should be clear that f(x0)=y0f(x_{0})=y_{0} and so x0x_{0} is the point we are looking for: see Figure 4.25. In order to prove this is the case, we use a Goldilocks approach: we show f(x0)y0f(x_{0})\not>y_{0} (not too hot) and f(x0)y0f(x_{0})\not<y_{0} (not too cold), and thereby conclude f(x0)=y0f(x_{0})=y_{0} (just right).

Arguing by contradiction, suppose f(x0)>y0f(x_{0})>y_{0}. By Lemma 4.94 (a), there exists some δ>0\delta>0 such that f(x)>y0f(x)>y_{0} for all x[a,b]x\in[a,b] with |xx0|<δ|x-x_{0}|<\delta. On the other hand, since x0x_{0} is the supremum of EE, there exists some cEc\in E such that x0δ<cx0x_{0}-\delta<c\leq x_{0} (see Lemma 1.31). Since cEc\in E, we have f(c)<y0f(c)<y_{0}. However, |cx0|<δ|c-x_{0}|<\delta and so we must have f(c)>y0f(c)>y_{0}. This is a contradiction. Therefore, we must have f(x0)y0f(x_{0})\leq y_{0}. Note, in particular, this tells us that x0bx_{0}\neq b, since f(b)>y0f(b)>y_{0}.

Now suppose f(x0)<y0f(x_{0})<y_{0}. By Lemma 4.94 (b), there exists some δ>0\delta>0 such that f(x)<y0f(x)<y_{0} for all x[a,b]x\in[a,b] with |xx0|<δ|x-x_{0}|<\delta. Since x0<bx_{0}<b, it follows that there exists some d[a,b]d\in[a,b] satisfying x0<d<min{x0+δ,b}x_{0}<d<\min\{x_{0}+\delta,b\}: see Figure 4.26.

Figure 4.26: The choice of dd from the proof of the intermediate value theorem.

Since |dx0|<δ|d-x_{0}|<\delta, it follows that f(d)<y0f(d)<y_{0} so that dEd\in E. However, x0<dx_{0}<d, which contradicts the fact that x0x_{0} is the supremum of EE. Therefore, we must have f(x0)y0f(x_{0})\geq y_{0}.

Since we have shown f(x0)y0f(x_{0})\leq y_{0} and f(x0)y0f(x_{0})\geq y_{0}, it follows that f(x0)=y0f(x_{0})=y_{0}, as required. ∎

We have already seen that the intermediate value theorem gives us a quick and easy way to define radicals such as 2\sqrt{2}. However, it has many other important uses. We give one further application here and explore many more applications in Worksheet 8.

Corollary 4.95.

Let II\subseteq\mathbb{R} be an interval and f:If\colon I\to\mathbb{R} be continuous. Then the image Im(f):={f(x):xI}\mathrm{Im}(f):=\{f(x):x\in I\} is an interval.

We illustrate Corollary 4.95 in Figure 4.27 . This is another manifestation of the idea that the graphs of continuous functions do not have any ‘breaks’ or ‘jumps’.

Figure 4.27: Examples illustrating Corollary 4.95. In both cases, f:[a,b]f\colon[a,b]\to\mathbb{R} is continuous and the image Im(f)\mathrm{Im}(f) is an interval.

To prove Corollary 4.95 we shall use a simple characterisation of intervals. In particular, the following are equivalent:

  1. 1.

    EE\subseteq\mathbb{R} is an interval;

  2. 2.

    If yy\in\mathbb{R} such that y1<y<y2y_{1}<y<y_{2} for some y1y_{1}, y2Ey_{2}\in E then yEy\in E.

Condition 2 says that any point yy sandwiched in between two points y1y_{1}, y2y_{2} belonging to EE also belongs to EE. This characterisation should be intuitive and can be proved by considering the supremum and infimum of EE, treating the cases where EE is bounded or unbounded above or below separately.

Proof (of Corollary 4.95).

Pick y1y_{1}, y2Im(f)y_{2}\in\mathrm{Im}(f) with y1<y2y_{1}<y_{2} and let y1<y<y2y_{1}<y<y_{2}, By the intermediate value theorem, there exists some xIx\in I such that f(x)=yf(x)=y. Hence yIm(f)y\in\mathrm{Im}(f). It therefore follows from the above characterisation that Im(f)\mathrm{Im}(f) is an interval. ∎

Exercise 4.96.

Show that there exists a function f:[1,1]f\colon[-1,1]\to\mathbb{R} such that the image Im(f)\mathrm{Im}(f) is not an interval. Thus, the hypothesis that ff is continuous is necessary in Corollary 4.95.

Example 4.97.

Consider the restriction of the exponential function exp:[0,)[1,)\exp\colon[0,\infty)\to[1,\infty) to the non-negative real line.

Recall (from Proposition 4.6) that it is immediate from the formula (4.2) that exp\exp is increasing on [0,)[0,\infty) and exp(x)exp(0)=1\exp(x)\geq\exp(0)=1 for all xx\in\mathbb{R}. Thus, exp\exp is an injective function on [0,)[0,\infty).

We claim exp:[0,)[1,)\exp\colon[0,\infty)\to[1,\infty) is also a surjective function. We know from Exercise 4.82 (iii) that limxexp(x)=\lim_{x\to\infty}\exp(x)=\infty and so given any y1y\geq 1 there exists some b>0b>0 such that exp(0)=1yexp(b)\exp(0)=1\leq y\leq\exp(b). Since exp\exp is continuous, by the intermediate value theorem there exists some x[1,b][1,)x\in[1,b]\subset[1,\infty) such that exp(x)=y\exp(x)=y. This shows exp:[0,)[1,)\exp\colon[0,\infty)\to[1,\infty) is surjective, as claimed.

As mentioned earlier, these results continue to hold for exp:(0,)\exp\colon\mathbb{R}\to(0,\infty) defined on the entire real line, but we shall postpone the proof until the next chapter.

Exercise 4.98.

Let f:f\colon\mathbb{R}\to\mathbb{R} be continuous and satisfy limxf(x)=\displaystyle\lim_{x\to\infty}f(x)=\infty and limxf(x)=\displaystyle\lim_{x\to-\infty}f(x)=-\infty. Show that ff is surjective.

The boundedness theorem

There are many examples of unbounded continuous functions: for instance, x2x^{2} is unbounded on \mathbb{R}. This example is clearly related to the fact that \mathbb{R} is an unbounded domain. Another kind of example is 1/x1/x, which is continuous and unbounded on the bounded domain (0,1)(0,1).

Intuitively, the unboundedness of 1/x1/x occurs because the open interval (0,1)(0,1) has a ‘hole’ at 0, which allows the function to escape off to infinity. If we consider a continuous function f:[a,b]f\colon[a,b]\to\mathbb{R} on a closed, bounded interval [a,b][a,b], then there are no such means for the function to escape to infinity.

Exercise 4.99.

Observe that x2x^{2} is bounded on any closed, bounded interval [a,b][a,b]\subset\mathbb{R} and 1/x1/x is bounded on any closed, bounded interval [a,b](0,1)[a,b]\subset(0,1).

From the above, we might begin to expect that any continuous function f:[a,b]f\colon[a,b]\to\mathbb{R} is bounded. The following theorem shows this is indeed the case.

Theorem 4.100 (Boundedness theorem).

Let aa, bb\in\mathbb{R} with a<ba<b. If f:[a,b]f\colon[a,b]\to\mathbb{R} is continuous then ff is bounded.

As we have already observed, in Theorem 4.100 it is important to consider continuous functions defined in a closed bounded interval [a,b][a,b]. Indeed, the functions x2x^{2} and 1/x1/x show that the result can fail for continuous functions defined over other kinds of intervals.

Exercise 4.101.

Show that the conclusion of Theorem 4.100 can also fail if ff is not continuous. In particular, find an example of an unbounded discontinuous function f:[0,1]f\colon[0,1]\to\mathbb{R}.

To prove Theorem 4.100, our first step is to establish the following ‘local’ version.33 3 We essentially already saw this in Exercise 4.48.

Lemma 4.102 (Local boundedness).

Let II\subseteq\mathbb{R} be an interval and f:If\colon I\to\mathbb{R} be continuous at x0Ix_{0}\in I. Then there exists some δ>0\delta>0 such that ff is bounded on I(x0δ,x0+δ)I\cap(x_{0}-\delta,x_{0}+\delta).

Proof.

Since ff is continuous at x0x_{0}, by taking ε:=1\varepsilon:=1 in the ε\varepsilon-δ\delta definition of continuity, we see that there exists some δ>0\delta>0 such that

|f(x)f(x0)|<1for all xI with |xx0|<δ.|f(x)-f(x_{0})|<1\qquad\text{for all $x\in I$ with $|x-x_{0}|<\delta$.}

Let M:=1+|f(x0)|M:=1+|f(x_{0})|. Then, by the triangle inequality, we see that

|f(x)|\displaystyle|f(x)| =|f(x)f(x0)+f(x0)|\displaystyle=|f(x)-f(x_{0})+f(x_{0})|
|f(x)f(x0)|+|f(x0)|\displaystyle\leq|f(x)-f(x_{0})|+|f(x_{0})|
<1+(M1)\displaystyle<1+(M-1)
=Mfor all xI(x0δ,x0+δ).\displaystyle=M\qquad\text{for all $x\in I\cap(x_{0}-\delta,x_{0}+\delta)$.}

Thus, ff is bounded on I(x0δ,x0+δ)I\cap(x_{0}-\delta,x_{0}+\delta), as required. ∎

Armed with Lemma 4.102, we now turn to the proof of Theorem 4.100. The argument also relies on the least upper bound axiom. This should perhaps not come as a surprise: we have already noted that boundedness of continuous functions is related to the presence or lack of ‘holes’ in the domain.

Proof (of Theorem 4.100).

Let

E:={x[a,b]: f is bounded on [a,x]}.E:=\big{\{}x\in[a,b]:\text{ $f$ is bounded on $[a,x]$}\big{\}}.

Our goal is to show that bEb\in E. Indeed, this means precisely that ff is bounded on the whole interval [a,b][a,b], which is what we want to show.

Note that aEa\in E so that EE is nonempty and that EE is bounded above by bb. Thus, by the completeness axiom, s:=supEs:=\sup E exists.

Claim: sEs\in E and s=bs=b.

Once we have the claim, then we are done since this shows bEb\in E.

Since asba\leq s\leq b, the function ff is defined at ss and, moreover is continuous at that point. By Lemma 4.102, there exists some δ>0\delta>0 such that ff is bounded on [a,b](sδ,s+δ)[a,b]\cap(s-\delta,s+\delta). In particular, there exists some M1>0M_{1}>0 such that

(4.16) (4.16) |f(x)|M1for all x[a,b](sδ,s+δ).|f(x)|\leq M_{1}\qquad\text{for all $x\in[a,b]\cap(s-\delta,s+\delta)$.}

On the other hand, by the approximation property of the supremum, there exists some cEc\in E such that sδ<c<ss-\delta<c<s. In particular, since cEc\in E, we know that ff is bounded on [a,c][a,c] and so there exists some M2>0M_{2}>0 such that

(4.17) (4.17) |f(x)|M2for all x[a,c].|f(x)|\leq M_{2}\qquad\text{for all $x\in[a,c]$.}

Combining (4.16) and (4.17), for M:=max{M1,M2}M:=\max\{M_{1},M_{2}\} we see that

(4.18) (4.18) |f(x)|Mfor all x[a,b][a,s+δ).|f(x)|\leq M\qquad\text{for all $x\in[a,b]\cap[a,s+\delta)$.}

It immediately follows from (4.18) that ff is bounded on [a,s][a,s] and so sEs\in E. This establishes the first part of the claim.

It remains to show s=bs=b. We already know that sbs\leq b and so it suffices to show sbs\geq b.

We argue by contradiction, assuming s<bs<b. Under this assumption, we can find some dd such that s<d<min{s+δ,b}s<d<\min\{s+\delta,b\}. By (4.18), the function ff is bounded on [a,d][a,d] and so dEd\in E. However, d>sd>s so this contradicts the fact that the supremum is an upper bound for EE. Hence, we must have s=bs=b as claimed. ∎

The extreme value theorem

By Theorem 4.100, any continuous function f:[a,b]f\colon[a,b]\to\mathbb{R} is automatically bounded. Our goal is now to prove an upgrade of this theorem, by showing ff attains both a maximum and minimum value.

Definition 4.103.

Let EE\subseteq\mathbb{R} and f:Ef\colon E\to\mathbb{R}.

  1. 1

    We say xMEx_{M}\in E is a maximum point for ff if f(x)f(xM)f(x)\leq f(x_{M}) for all xEx\in E;

  2. 2

    We say xmEx_{m}\in E is a minimum point for ff if f(x)f(xm)f(x)\geq f(x_{m}) for all xEx\in E.

If a function f:Ef\colon E\to\mathbb{R} has a maximum (respectively, minimum) point, then it is bounded above (respectively, below). However, the converse of this statement is not true.

Exercise 4.104.

Recall the function f:f\colon\mathbb{R}\to\mathbb{R} given by f(x):=1(1+x2)1f(x):=1-(1+x^{2})^{-1} for all xx\in\mathbb{R} from Exercise 4.11. Show that ff is bounded above by 11 but has no maximum point.

Often, whether or not a function has a maximum or a minimum point depends on the domain of the function. For instance, if we let R>0R>0 and consider the restriction f|[R,R]f|_{[-R,R]} of the function in Exercise 4.104 to the interval [R,R][-R,R], then f|[R,R]f|_{[-R,R]} has maximum points at R-R and RR.

Exercise 4.105.

Show that the function p2:[0,1]p_{2}\colon[0,1]\to\mathbb{R} given by p2(x):=x2p_{2}(x):=x^{2} for all x[0,1]x\in[0,1] has a maximum point, but the restriction p2|(0,1):(0,1)p_{2}|_{(0,1)}\colon(0,1)\to\mathbb{R} has no maximum point.

The contrasting behaviour of the functions in Exercise 4.105, which only differ in whether their domain is a closed interval or an open interval, hints at another special behaviour of continuous functions on closed, bounded intervals.

Theorem 4.106 (Extreme value theorem).

Let aa, bb\in\mathbb{R} with a<ba<b and f:[a,b]f\colon[a,b]\to\mathbb{R} be continuous. Then there exist xmx_{m}, xM[a,b]x_{M}\in[a,b] such that

(4.19) (4.19) f(xm)f(x)f(xM)for all x[a,b].f(x_{m})\leq f(x)\leq f(x_{M})\qquad\text{for all $x\in[a,b]$.}

In particular, ff has a minimum point and a maximum point on [a,b][a,b].

Theorem 4.106 is an upgrade of Theorem 4.100: not only does (4.19) imply that ff is bounded, but it also tells us that ff attains its (least upper and greatest lower) bounds.

In Theorem 4.106 it is important to consider continuous functions defined on a closed, bounded interval [a,b][a,b]. Indeed, Exercise 4.105 shows that a bounded, continuous function on the bounded interval (0,1)(0,1) can fail to have a maximum point – so the “closed” assumption is essential. Likewise, Exercise 4.104 shows that a bounded, continuous function on an unbounded interval can fail to have a maximum point – so the “bounded” assumption is also essential. Hence, we need both the closed and the bounded hypothesis to ensure the conclusion holds.

Proof (of Theorem 4.106).

We show the existence of a maximum point. The existence of a minimum point can be shown in a similar manner, or can be derived from the existence of a maximum point using a reflection argument (replacing ff with f-f).

Since f:[a,b]f\colon[a,b]\to\mathbb{R} is continuous, by Theorem 4.100 it is bounded. In particular, the image

E:=Im(f):={f(x):x[a,b]}E:=\mathrm{Im}(f):=\{f(x):x\in[a,b]\}

is nonempty and bounded above. Hence, by the completeness axiom s:=supEs:=\sup E exists.

We claim that there exists some xM[a,b]x_{M}\in[a,b] such that f(xM)=sf(x_{M})=s. Once this is established, it follows that f(x)f(xM)f(x)\leq f(x_{M}) for all x[a,b]x\in[a,b], since ss is an upper bound for E=Im(f)E=\mathrm{Im}(f).

It remains to prove the claim. We argue by contradiction, assuming that there does not exist any x[a,b]x\in[a,b] such that f(x)=sf(x)=s. In this case, the function

g:[a,b];g(x):=sf(x)for all x[a,b]g\colon[a,b]\to\mathbb{R};\qquad g(x):=s-f(x)\qquad\text{for all $x\in[a,b]$}

satisfies g(x)>0g(x)>0 for all x[a,b]x\in[a,b]. Thus, by Corollary 4.51, the function 1/g:[a,b]1/g\colon[a,b]\to\mathbb{R} is well-defined and continuous. By the boundedness theorem applied to 1/g1/g, there exists some M>0M>0 such that 0<1/g(x)M0<1/g(x)\leq M for all x[a,b]x\in[a,b] and so

(4.20) (4.20) sf(x)=g(x)1/Mfor all x[a,b].s-f(x)=g(x)\geq 1/M\qquad\text{for all $x\in[a,b]$.}

However, since ss is the supremum of EE, by taking ε:=1/M\varepsilon:=1/M in the approximation property, there must exist some yEy\in E such that s1/M<y<ss-1/M<y<s. In particular, y=f(x)y=f(x) for some x[a,b]x\in[a,b] and rearranging gives sf(x)<1/Ms-f(x)<1/M, which contradicts (4.20). Consequently, there must exist some xM[a,b]x_{M}\in[a,b] such that f(xM)=sf(x_{M})=s, as required. ∎