Chapter V · Limits of functions of a continuous variable. Continuous and discontinuous functions

The intermediate value theorem

§§101–102 35 min

A continuous function takes every value between any two of its values; Hardy’s proof by a Dedekind section, the bisection proof, why the converse fails, and the persistence of sign.

Why this matters

If a continuous curve starts below a horizontal line and ends above it, it must cross the line. This is obvious to the eye, and it is false for the rational numbers (the graph of x2−2x^2 - 2 “crosses” the axis at a hole in Q\mathbb{Q}), so its proof must use the completeness of the real numbers. In §101 Hardy proves it with a Dedekind section, the tool of §17. The theorem guarantees that equations have solutions, it underlies the existence of inverse functions (§110), and its proof is the model for the other great theorems of this chapter.

The idea

Take ϕ\phi continuous on [x0,x1][x_0, x_1] with ϕ(x0)<η<ϕ(x1)\phi(x_0) < \eta < \phi(x_1). We want a point where ϕ=η\phi = \eta. Hardy’s idea is to look for the first such point. Walk right from x0x_0, and collect every ξ\xi for which ϕ\phi has stayed below η\eta all the way from x0x_0 to ξ\xi: these form the lower class LL. Everything else is the upper class RR. The pair (L,R)(L, R) is a section of the real numbers, so it defines a number ξ0\xi_0, the place where “always below η\eta” stops being true. Continuity then forces ϕ(ξ0)=η\phi(\xi_0) = \eta: it cannot be below η\eta (or ϕ\phi would stay below a little further), and it cannot be above (or ϕ\phi would already have been above a little earlier).

Explore Hardy’s section, drawn

Try this. Move the level η\eta up and down. Watch the green class LL, the orange class RR, the purple section point ξ0\xi_0, and the ochre dots marking every solution of ϕ(x)=η\phi(x) = \eta.

ϕ(x)=12x+sin⁡52x\phi(x) = \tfrac12 x + \sin\tfrac52 x on [0,4][0, 4]: ϕ(x0)=0\phi(x_0) = 0, ϕ(x1)=1.46\phi(x_1) = 1.46
xy
  • class L: φ < η all the way from x₀
  • class R: the rest
  • ξ₀, the section point, and φ(ξ₀)
  • the level η and every solution of φ(x) = η
The section point is ξ0=0.28658\xi_0 = 0.28658. φ is continuous there, and ϕ(ξ0)=0.8=η\phi(\xi_0) = 0.8 = \eta. Of the 3 solutions of ϕ(x)=η\phi(x) = \eta, ξ₀ is the least.
What to notice

Whatever η\eta is, the section point lands exactly on the curve’s first crossing of the level: ϕ(ξ0)=η\phi(\xi_0) = \eta, and ξ0\xi_0 is the least of the solutions. As η\eta passes the height of a local maximum, ξ0\xi_0 jumps from one bump of the curve to a later one, but it is always a solution.

Precise statements

Theorem The intermediate value theorem Hardy: §101

Let ϕ\phi be continuous on [x0,x1][x_0, x_1], and let η\eta lie strictly between ϕ(x0)\phi(x_0) and ϕ(x1)\phi(x_1). Then there is an xx between x0x_0 and x1x_1 with ϕ(x)=η\phi(x) = \eta. Moreover, if ϕ(x0)<η<ϕ(x1)\phi(x_0) < \eta < \phi(x_1) there is a least such xx.

In other words, as xx goes from x0x_0 to x1x_1, ϕ(x)\phi(x) takes every value between ϕ(x0)\phi(x_0) and ϕ(x1)\phi(x_1) at least once. The second sentence is a bonus of Hardy’s proof: the set of solutions of ϕ(x)=η\phi(x) = \eta has a least member, which is not true for an arbitrary set of numbers.

The converse is false: a function can take every intermediate value without being continuous.

Explore When the function is not continuous

Try this. Choose “a function with a jump” and put η\eta inside the gap of the graph, around 1.51.5. Then choose “Hardy’s Fig. 30 function” (it is 00 at 00, 1−x1 - x on (0,1)(0, 1) and 11 at 11) and try several η\eta.

ϕ(x)=12x+[12x]\phi(x) = \tfrac12 x + [\tfrac12 x] on [0,3.9][0, 3.9]: ϕ(x0)=0\phi(x_0) = 0, ϕ(x1)=2.95\phi(x_1) = 2.95
xy
  • class L: φ < η all the way from x₀
  • class R: the rest
  • ξ₀, the section point, and φ(ξ₀)
  • the level η and every solution of φ(x) = η
The section point is ξ0=2\xi_0 = 2. Here ϕ(ξ0)=2>η\phi(\xi_0) = 2 > \eta although ϕ<η\phi < \eta just to its left (Hardy’s first case): φ is discontinuous at ξ₀. And φ never takes the value η.
What to notice

With the jump, the section point is the jump itself: ϕ(ξ0)>η\phi(\xi_0) > \eta while ϕ<η\phi < \eta just to the left, Hardy’s first case, and no solution exists. Fig. 30 shows the second case: ξ0=0\xi_0 = 0, where ϕ(0)=0<η\phi(0) = 0 < \eta but values above η\eta occur arbitrarily close on the right. Yet that function does take every value between 00 and 11, each exactly once. Taking all intermediate values does not imply continuity.

For monotone functions, though, the converse is true, and this is the case that matters for inverse functions.

Theorem Monotone functions with the intermediate value property are continuous Hardy: §101

If ϕ\phi is steadily increasing (or decreasing) on [x0,x1][x_0, x_1] and takes every value between ϕ(x0)\phi(x_0) and ϕ(x1)\phi(x_1), then ϕ\phi is continuous on [x0,x1][x_0, x_1].

§102 adds two simple facts that we will use constantly.

Theorem Persistence of sign Hardy: Theorem 1, §102

If ϕ\phi is continuous at ξ\xi and ϕ(ξ)>0\phi(\xi) > 0, there is δ>0\delta > 0 such that ϕ(x)>0\phi(x) > 0 throughout (ξ−δ,ξ+δ)(\xi - \delta, \xi + \delta). Likewise for ϕ(ξ)<0\phi(\xi) < 0.

Corollary Values of both signs nearby force a zero Hardy: Theorem 2, §102

If ϕ\phi is continuous at ξ\xi, and ϕ\phi vanishes, or takes both positive and negative values, at points arbitrarily close to ξ\xi, then ϕ(ξ)=0\phi(\xi) = 0.

Proofs

Proof The intermediate value theorem (Hardy’s proof)
Strategy

Suppose ϕ(x0)<η<ϕ(x1)\phi(x_0) < \eta < \phi(x_1) (the other case is the same with inequalities reversed, or apply this case to −ϕ-\phi). Define the section (L,R)(L, R) described above, let ξ0\xi_0 be its number, and show that ϕ(ξ0)>η\phi(\xi_0) > \eta and ϕ(ξ0)<η\phi(\xi_0) < \eta both contradict continuity at ξ0\xi_0.

Both classes are non-empty

Since ϕ(x0)<η\phi(x_0) < \eta and ϕ\phi is continuous at x0x_0, ϕ\phi stays below η\eta on some interval [x0,x0+h][x_0, x_0 + h] (persistence of sign applied to η−ϕ\eta - \phi): those points are in LL. Similarly ϕ>η\phi > \eta near x1x_1, so points near x1x_1 are in RR.

(L,R)(L, R) is a section

Put ξ∈L\xi \in L if ϕ(x)<η\phi(x) < \eta for every xx in [x0,ξ][x_0, \xi], and ξ∈R\xi \in R otherwise. Every point is in exactly one class, and if ξ∈L\xi \in L and ξ′<ξ\xi' < \xi then ξ′∈L\xi' \in L too (the condition on [x0,ξ][x_0, \xi] includes [x0,ξ′][x_0, \xi']). So every member of LL lies to the left of every member of RR. By Dedekind’s theorem (§17) there is a number ξ0\xi_0 with LL to its left and RR to its right.

ϕ(ξ0)>η\phi(\xi_0) > \eta is impossible

Then ξ0\xi_0 would be in RR, and every ξ′<ξ0\xi' < \xi_0 is in LL, so ϕ(ξ′)<η\phi(\xi') < \eta. With k=ϕ(ξ0)−η>0k = \phi(\xi_0) - \eta > 0 we would have ϕ(ξ0)−ϕ(ξ′)>k\phi(\xi_0) - \phi(\xi') > k for all ξ′\xi' to the left of ξ0\xi_0, however close. That contradicts continuity at ξ0\xi_0 (take tolerance kk).

ϕ(ξ0)<η\phi(\xi_0) < \eta is impossible

Let k=η−ϕ(ξ0)>0k = \eta - \phi(\xi_0) > 0. Every ξ′>ξ0\xi' > \xi_0 is in RR, so somewhere in (ξ0,ξ′](\xi_0, \xi'] there is a point where ϕ≥η\phi \ge \eta, that is, where ϕ\phi differs from ϕ(ξ0)\phi(\xi_0) by at least kk. Such points exist arbitrarily close to ξ0\xi_0, again contradicting continuity. (And ϕ<η\phi < \eta on [x0,ξ0)[x_0, \xi_0) by the definition of LL, so the bad case cannot arise there either.)

So ϕ(ξ0)=η\phi(\xi_0) = \eta, and ξ0\xi_0 is the least solution

Every x<ξ0x < \xi_0 lies in LL, where ϕ(x)<η\phi(x) < \eta; so no solution comes before ξ0\xi_0.

There is a second proof, by repeated bisection, which is also an algorithm. Halve [x0,x1][x_0, x_1]; at least one half has ϕ−η\phi - \eta of opposite signs at its ends (or ϕ=η\phi = \eta at the midpoint, and we are done). Keep that half and repeat. The intervals are nested and their lengths (x1−x0)/2n(x_1 - x_0)/2^n tend to 00, so they close in on a single point ξ\xi (§71). At points as close to ξ\xi as we please, ϕ−η\phi - \eta takes both signs, so by Theorem 2 of §102, ϕ(ξ)=η\phi(\xi) = \eta.

Explore The bisection proof, run as an algorithm

Try this. Press “Halve” several times for x3−3x+1x^3 - 3x + 1 on [0,1][0, 1] and watch the interval shrink. Read off the root to four decimal places.

Bisection for a root of f(x)=x3−3x+1f(x)=x^3-3x+1 on [0,1][0, 1]
xy
00.51
  • earlier intervals
  • current interval
  • y = f(x)
Step 0: [0, 1][0,\ 1], width (b−a)/20=1(b-a)/2^{0} = 1. f(a)=1f(a) = 1 and f(b)=−1f(b) = −1 have opposite signs, so a root lies between them. The intervals are nested and their widths tend to 0, so they close on exactly one point.
What to notice

Each step keeps the half where the sign changes, so a root is always trapped. Ten halvings shrink the interval by a factor of 10241024: the root is 0.3473…0.3473\ldots. Notice what the proof needs: nested intervals closing on a point (completeness) and Theorem 2 at that point (continuity).

Proof Persistence of sign
Strategy

Use the definition of continuity with the tolerance ε=12ϕ(ξ)\varepsilon = \tfrac12\phi(\xi): values within half of ϕ(ξ)\phi(\xi) of a positive number are still positive.

Choose ε=12ϕ(ξ)>0\varepsilon = \tfrac12\phi(\xi) > 0

By continuity there is δ>0\delta > 0 with ∣ϕ(x)−ϕ(ξ)∣<12ϕ(ξ)|\phi(x) - \phi(\xi)| < \tfrac12\phi(\xi) whenever ∣x−ξ∣<δ|x - \xi| < \delta.

Then ϕ(x)>12ϕ(ξ)>0\phi(x) > \tfrac12\phi(\xi) > 0 there

Indeed ϕ(x)>ϕ(ξ)−12ϕ(ξ)=12ϕ(ξ)\phi(x) > \phi(\xi) - \tfrac12\phi(\xi) = \tfrac12\phi(\xi). Theorem 2 follows: if ϕ(ξ)\phi(\xi) were positive (or negative), ϕ\phi would keep that sign on a whole interval round ξ\xi, so could not vanish or change sign at points arbitrarily close to ξ\xi.

Proof Monotone with the intermediate value property implies continuous
Strategy

A monotone function has one-sided limits everywhere (§95), so its only possible discontinuities are jumps. A jump leaves a gap of values that are never taken.

One-sided limits exist

Let ϕ\phi increase steadily and x0<ξ<x1x_0 < \xi < x_1. Then ϕ(ξ−0)≤ϕ(ξ)≤ϕ(ξ+0)\phi(\xi - 0) \le \phi(\xi) \le \phi(\xi + 0).

Suppose ϕ(ξ−0)<ϕ(ξ)\phi(\xi - 0) < \phi(\xi)

For x<ξx < \xi, ϕ(x)≤ϕ(ξ−0)\phi(x) \le \phi(\xi - 0); for x≥ξx \ge \xi, ϕ(x)≥ϕ(ξ)\phi(x) \ge \phi(\xi). So no value strictly between ϕ(ξ−0)\phi(\xi - 0) and ϕ(ξ)\phi(\xi) is ever taken, although such values lie between ϕ(x0)\phi(x_0) and ϕ(x1)\phi(x_1). Contradiction.

Conclude

So ϕ(ξ−0)=ϕ(ξ)\phi(\xi - 0) = \phi(\xi), and likewise ϕ(ξ+0)=ϕ(ξ)\phi(\xi + 0) = \phi(\xi): ϕ\phi is continuous at ξ\xi. The end points are handled in the same way, using one side only.

Worked examples and exercises

Exercise Polynomials of odd degree ●○○ Hardy: §101

Show that every polynomial P(x)=a0xn+a1xn−1+⋯+anP(x) = a_0x^n + a_1x^{n-1} + \dots + a_n of odd degree nn (with a0≠0a_0 \ne 0) has at least one real root.

Hint
Divide by xnx^n: P(x)/xn→a0P(x)/x^n \to a_0 as x→±∞x \to \pm\infty.

Solution

We may take a0>0a_0 > 0. Since P(x)/xn=a0+a1/x+⋯+an/xn→a0P(x)/x^n = a_0 + a_1/x + \dots + a_n/x^n \to a_0, there is X>0X > 0 with P(x)/xn>12a0>0P(x)/x^n > \tfrac12 a_0 > 0 for ∣x∣≥X|x| \ge X. Hence P(X)P(X) has the sign of Xn>0X^n > 0, and P(−X)P(-X) has the sign of (−X)n<0(-X)^n < 0 (nn odd). PP is continuous on [−X,X][-X, X] and 00 lies strictly between P(−X)P(-X) and P(X)P(X), so P(x)=0P(x) = 0 for some xx in between.

Exercise A fixed point ●●○ Hardy: §101

Let ff be continuous on [0,1][0, 1] with 0≤f(x)≤10 \le f(x) \le 1 for every xx. Show that f(c)=cf(c) = c for some cc in [0,1][0, 1]. Draw the picture.

Hint
Apply the theorem to g(x)=f(x)−xg(x) = f(x) - x.

Solution

gg is continuous, g(0)=f(0)≥0g(0) = f(0) \ge 0 and g(1)=f(1)−1≤0g(1) = f(1) - 1 \le 0. If g(0)=0g(0) = 0 take c=0c = 0; if g(1)=0g(1) = 0 take c=1c = 1. Otherwise g(0)>0>g(1)g(0) > 0 > g(1) and the theorem gives cc in (0,1)(0, 1) with g(c)=0g(c) = 0. In the picture: the graph of ff runs from the left edge to the right edge of the unit square, so it must cross the diagonal y=xy = x.

Exercise ●●○ Hardy: Misc. Examples V, 17

Define ϕ\phi on [0,1][0, 1] by ϕ(0)=0\phi(0) = 0; ϕ(x)=12−x\phi(x) = \tfrac12 - x for 0<x<120 < x < \tfrac12; ϕ(12)=12\phi(\tfrac12) = \tfrac12; ϕ(x)=32−x\phi(x) = \tfrac32 - x for 12<x<1\tfrac12 < x < 1; ϕ(1)=1\phi(1) = 1. Show that ϕ\phi takes every value in [0,1][0, 1] exactly once, but is discontinuous at 00, 12\tfrac12 and 11. Check that ϕ(x)=12−x+12[2x]−12[1−2x]\phi(x) = \tfrac12 - x + \tfrac12[2x] - \tfrac12[1 - 2x].

Hint
List which values each of the five pieces takes.

Solution

Values. The pieces take: 00; every value in (0,12)(0, \tfrac12), once each (as xx runs over (0,12)(0, \tfrac12), 12−x\tfrac12 - x runs over (0,12)(0, \tfrac12)); 12\tfrac12; every value in (12,1)(\tfrac12, 1) once each; and 11. These sets are disjoint and fill [0,1][0, 1].

Discontinuities. ϕ(0+0)=12≠0=ϕ(0)\phi(0 + 0) = \tfrac12 \ne 0 = \phi(0); ϕ(12−0)=0\phi(\tfrac12 - 0) = 0 and ϕ(12+0)=1\phi(\tfrac12 + 0) = 1; ϕ(1−0)=12≠1\phi(1 - 0) = \tfrac12 \ne 1. All are simple discontinuities. The function is not monotone, which is why §101’s converse does not apply.

Formula. For 0<x<120 < x < \tfrac12: [2x]=0[2x] = 0, [1−2x]=0[1 - 2x] = 0, giving 12−x\tfrac12 - x. For 12<x<1\tfrac12 < x < 1: [2x]=1[2x] = 1, [1−2x]=−1[1 - 2x] = -1, giving 12−x+12+12=32−x\tfrac12 - x + \tfrac12 + \tfrac12 = \tfrac32 - x. At 00: 12+0−12=0\tfrac12 + 0 - \tfrac12 = 0; at 12\tfrac12: 0+12−0=120 + \tfrac12 - 0 = \tfrac12; at 11: −12+1+12=1-\tfrac12 + 1 + \tfrac12 = 1.

Exercise ●●○ Hardy: Theorem 2, §102

Let ϕ\phi be continuous everywhere and ϕ(x)=0\phi(x) = 0 for every rational xx. Show that ϕ(x)=0\phi(x) = 0 for every xx. Deduce that two continuous functions which agree at every rational point agree everywhere.

Hint
Every ξ\xi has rational numbers arbitrarily close to it.

Solution

Fix ξ\xi. There are rationals as close to ξ\xi as we please, and ϕ\phi vanishes at all of them. By Theorem 2 of §102, ϕ(ξ)=0\phi(\xi) = 0. If ff and gg are continuous and f=gf = g on the rationals, apply this to ϕ=f−g\phi = f - g. So a continuous function is determined by its values at the rationals, which is how axa^x for irrational xx can be defined from its rational values.

Check yourself

Check yourself True or false?

If ϕ\phi takes every value between ϕ(a)\phi(a) and ϕ(b)\phi(b) as xx goes from aa to bb, then ϕ\phi is continuous on [a,b][a, b].

Why

False. Hardy’s Fig. 30 function (00 at 00, 1−x1 - x on (0,1)(0, 1), 11 at 11) takes every value in [0,1][0, 1] exactly once and is discontinuous at both ends. The converse holds only with an extra hypothesis such as monotonicity.

Check yourself Choose one

ϕ(x)=1/x\phi(x) = 1/x has ϕ(−1)=−1\phi(-1) = -1 and ϕ(1)=1\phi(1) = 1, but 1/x=01/x = 0 has no solution. Which hypothesis of the theorem fails?

Why

Continuity is needed at every point of the closed interval. 1/x1/x has an infinity at 00, and the graph leaps from −∞-\infty to +∞+\infty without crossing the axis. No monotonicity is needed for the theorem.

Check yourself Enter a number

Bisection starts on [0,1][0, 1]. How many halvings are needed before the interval has length less than 0.0010.001?

Why

After nn halvings the length is 2−n2^{-n}. 2−9=1/512>0.0012^{-9} = 1/512 > 0.001 and 2−10=1/1024<0.0012^{-10} = 1/1024 < 0.001, so 1010.

Check yourself Choose one

Why is the intermediate value theorem false for functions defined only on the rational numbers?

Why

The proof uses Dedekind’s theorem: every section of the real numbers has a number at its boundary. The corresponding section of the rationals (those ξ\xi with ξ2<2\xi^2 < 2 on the left) has no rational boundary point; that is exactly the gap of Chapter I.

Hardy’s language

It should be observed that we have proved more than is asserted explicitly in the theorem; we have proved in fact that ξ0\xi_0 is the least value of xx for which ϕ(x)=η\phi(x) = \eta.

— G. H. Hardy, §101

Summary

Summary
  • A function continuous on [x0,x1][x_0, x_1] takes every value between ϕ(x0)\phi(x_0) and ϕ(x1)\phi(x_1); with ϕ(x0)<η<ϕ(x1)\phi(x_0) < \eta < \phi(x_1) there is even a least solution of ϕ(x)=η\phi(x) = \eta.
  • Hardy’s proof: the section point ξ0\xi_0 of “ϕ\phi stays below η\eta up to here” must satisfy ϕ(ξ0)=η\phi(\xi_0) = \eta, since either strict inequality contradicts continuity at ξ0\xi_0. The bisection proof traps the crossing in nested halves.
  • The converse is false in general (Fig. 30) but true for monotone functions.
  • Persistence of sign: a continuous function positive at ξ\xi is positive near ξ\xi; so values of both signs arbitrarily near ξ\xi force ϕ(ξ)=0\phi(\xi) = 0.