Book 2A

© 2026 Neckpinch · www.neckpinch.com · All rights reserved.

Course 2Book 2A: Numbers, Limits and the IntegralChapter 9

Continuous Functions

Continuity, the intermediate value theorem, uniform continuity, and the first maximum principle.

59 min read · Updated Nov 6, 2026

Read with Tao, Analysis I, chapter "Continuous functions on R" (subsets of the real line, limiting values of functions, continuous functions, left and right limits, the maximum principle, the intermediate value theorem, monotonic functions, uniform continuity, limits at infinity).

In this chapter · 8 sections
  1. 9.1Subsets of the real line
  2. 9.2Limits of functions and continuity
  3. 9.2.1What the definition says, and what the picture says
  4. 9.2.2One-sided limits
  5. 9.3The maximum principle
  6. 9.3.1What a function looks like at its maximum
  7. 9.4The intermediate value theorem
  8. 9.4.1A second proof: bisection
  9. 9.5Monotone functions and inverses
  10. 9.6Uniform continuity
  11. 9.6.1Measuring continuity: the modulus
  12. 9.7Limits at infinity
  13. 9.8Exercises
  14. ↗Free resources

A function is continuous if it has no jumps: small changes in the input cause small changes in the output. The precise definition is the ε–δ sentence of 2A.5 Quantifiers and the Shape of a Proof, and this chapter puts it to work. Its three main theorems sound almost too obvious to need proof:

  • a continuous function on a closed interval attains a largest and a smallest value;
  • a continuous function that is negative at one point and positive at another is zero somewhere in between;
  • a continuous function on a closed interval is uniformly continuous.

Each one is false if the real numbers are replaced by the rationals, or the closed interval by an open one. So each proof must use, somewhere, completeness or compactness, and seeing exactly where is the point of the chapter.

The first theorem is called the maximum principle in Tao's book (his Section 9.6), and the name is apt. Every maximum principle for the heat equation and for Ricci flow, the main tools of Courses 6 and 11, begins with exactly this statement and the observation of what a function looks like at its maximum.

By the end of this chapter you will be able to:

  • prove continuity and discontinuity from the definition, and with sequences;
  • compute limits of functions with the sequence criterion and the limit laws, including one-sided limits;
  • prove the maximum principle and the intermediate value theorem, say which property of R\mathbb{R} each uses, and apply them to show that equations have solutions;
  • distinguish continuity from uniform continuity, and prove the Heine–Cantor theorem;
  • explain why, at an interior maximum, the derivative vanishes and the second derivative is non-positive, and why that observation drives maximum principles for PDE.

Subsets of the real line

The behaviour of a function depends heavily on the set it is defined on, so we start there.

Definition 9.1 Adherent points, closure, closed sets

Let X⊆RX \subseteq \mathbb{R}. A real number xx is adherent to XX if for every ε>0\varepsilon > 0 some point of XX lies within ε\varepsilon of xx. The closure X‾\overline{X} is the set of all adherent points. XX is closed if X‾=X\overline{X} = X, that is, if XX contains every point that can be approximated from inside it.

So (0,1)‾=[0,1]\overline{(0, 1)} = [0, 1]: the endpoints are adherent to the open interval but not in it. Closed intervals [a,b][a, b] are closed, and so are R\mathbb{R}, N\mathbb{N} and Z\mathbb{Z}. The rationals are not: Q‾=R\overline{\mathbb{Q}} = \mathbb{R}, by density (2A.4 The Real Numbers).

In terms of sequences: xx is adherent to XX exactly when some sequence of points of XX converges to xx. So a set is closed exactly when limits of convergent sequences in it stay in it.

Proposition 9.2 Adherent points are limits

A real xx is adherent to XX if and only if there is a sequence (xn)(x_n) of points of XX with xn→xx_n \to x. Consequently XX is closed if and only if every convergent sequence of points of XX has its limit in XX. Moreover, the closure X‾\overline X is itself closed.

Proof. If xx is adherent, then for each n≥1n \geq 1 there is a point xn∈Xx_n \in X with ∣xn−x∣≤1n|x_n - x| \leq \frac1n; the sequence (xn)(x_n) converges to xx by the squeeze theorem. Conversely, if xn→xx_n \to x with xn∈Xx_n \in X, then for every ε>0\varepsilon > 0 some xnx_n (indeed all late ones) lies within ε\varepsilon of xx, so xx is adherent.

For the second statement: XX is closed when every adherent point is in XX, and by the first part the adherent points are exactly the limits of convergent sequences in XX.

Finally, let xx be adherent to X‾\overline X, and ε>0\varepsilon > 0. Some y∈X‾y \in \overline X has ∣y−x∣≤ε/2|y - x| \leq \varepsilon/2, and since yy is adherent to XX, some z∈Xz \in X has ∣z−y∣≤ε/2|z - y| \leq \varepsilon/2. Then ∣z−x∣≤ε|z - x| \leq \varepsilon. So xx is adherent to XX, that is, x∈X‾x \in \overline X.

Example 9.3 Which sets are closed?
  • [a,b][a, b] is closed: if xn∈[a,b]x_n \in [a, b] and xn→xx_n \to x, then a≤xn≤ba \leq x_n \leq b for every nn gives a≤x≤ba \leq x \leq b, because limits preserve non-strict inequalities (2A.6 Sequences).
  • (a,b)(a, b) is not closed: a+1n→a∉(a,b)a + \frac1n \to a \notin (a, b). Its closure is [a,b][a, b].
  • {1n:n≥1}\{\frac1n : n \geq 1\} is not closed: its points converge to 00, which is not in the set. Adding 00 makes it closed.
  • Z\mathbb{Z} is closed: a convergent sequence of integers is Cauchy, so eventually its terms are within 12\frac12 of each other, hence eventually constant, and its limit is that integer.

The proof for [a,b][a, b] shows why non-strict inequalities define closed sets: "≤\leq" survives limits, "<<" doesn't. The same reasoning shows that sets like {x:f(x)≤0}\{x : f(x) \leq 0\} are closed whenever ff is continuous (Exercise 9.31), which is how closed sets usually arise in practice.

Theorem 9.4 Heine–Borel, for the real line

For X⊆RX \subseteq \mathbb{R}, the following are equivalent:

  1. XX is closed and bounded;
  2. every sequence in XX has a subsequence converging to a point of XX.

Proof. (1 ⇒ 2) A sequence in a bounded XX is bounded, so by Bolzano–Weierstrass (2A.6 Sequences) a subsequence converges to some xx; and x∈Xx \in X because XX is closed. (2 ⇒ 1) If XX were unbounded, there would be xn∈Xx_n \in X with ∣xn∣≥n|x_n| \geq n, and no subsequence could converge. If XX weren't closed, there would be an adherent x∉Xx \notin X and a sequence in XX converging to xx; every subsequence also converges to xx, which isn't in XX.

Property 2 is called (sequential) compactness, and closed bounded intervals [a,b][a, b] are the model compact sets. In 2B.3 Compactness compactness is defined for general spaces, where "closed and bounded" no longer suffices. Property 2 is the one that survives.

Limits of functions and continuity

Definition 9.5 Limit of a function

Let f:X→Rf : X \to \mathbb{R} and let x0x_0 be adherent to XX. We say f(x)→Lf(x) \to L as x→x0x \to x_0 in XX if for every ε>0\varepsilon > 0 there is δ>0\delta > 0 such that ∣f(x)−L∣≤ε|f(x) - L| \leq \varepsilon for every x∈Xx \in X with ∣x−x0∣<δ|x - x_0| < \delta.

The point x0x_0 need not lie in XX, only be adherent to it: this is what allows lim⁡x→0sin⁡xx\lim_{x \to 0} \frac{\sin x}{x}, where the function is not defined at 00. And if x0x_0 is in XX, the value f(x0)f(x_0) plays no role in the definition except through the condition ∣x−x0∣<δ|x - x_0| < \delta, which includes x=x0x = x_0. (Tao follows this convention; some books exclude x=x0x = x_0 and speak of "punctured" neighbourhoods. The difference matters only at points where ff is discontinuous.)

Limits of functions reduce to limits of sequences, which brings all of 2A.6 Sequences to bear.

Proposition 9.6 The sequence criterion for limits

Let x0x_0 be adherent to XX. Then f(x)→Lf(x) \to L as x→x0x \to x_0 in XX if and only if f(xn)→Lf(x_n) \to L for every sequence (xn)(x_n) in XX with xn→x0x_n \to x_0. In particular the limit, when it exists, is unique.

Proof. (⇒) Let xn→x0x_n \to x_0 in XX and ε>0\varepsilon > 0. Take δ\delta from the definition, then NN with ∣xn−x0∣<δ|x_n - x_0| < \delta for n≥Nn \geq N. For those nn, ∣f(xn)−L∣≤ε|f(x_n) - L| \leq \varepsilon.

(⇐) Suppose f(x)↛Lf(x) \not\to L. Negating the definition (2A.5 Quantifiers and the Shape of a Proof): there is ε>0\varepsilon > 0 such that for every δ>0\delta > 0 some x∈Xx \in X has ∣x−x0∣<δ|x - x_0| < \delta and ∣f(x)−L∣>ε|f(x) - L| > \varepsilon. With δ=1n\delta = \frac1n this gives xn∈Xx_n \in X with xn→x0x_n \to x_0 but ∣f(xn)−L∣>ε|f(x_n) - L| > \varepsilon for every nn, so f(xn)↛Lf(x_n) \not\to L.

Uniqueness: since x0x_0 is adherent, there is at least one sequence xn→x0x_n \to x_0 in XX (Proposition 9.2), and along it f(xn)f(x_n) has at most one limit.

Corollary 9.7 Limit laws for functions

If f(x)→Lf(x) \to L and g(x)→Mg(x) \to M as x→x0x \to x_0 in XX, then f+g→L+Mf + g \to L + M, fg→LMfg \to LM, cf→cLcf \to cL, and, if M≠0M \neq 0 and gg is nonzero on XX, f/g→L/Mf/g \to L/M.

Proof. Take any sequence xn→x0x_n \to x_0 in XX. Then f(xn)→Lf(x_n) \to L and g(xn)→Mg(x_n) \to M, so by the limit laws for sequences (2A.6 Sequences), f(xn)+g(xn)→L+Mf(x_n) + g(x_n) \to L + M, and similarly for the others. By Proposition 9.6 this gives the limits of the functions.

Example 9.8 Computing limits of functions, and one trap

(a) Cancelling a common factor. Find lim⁡x→2x2−4x−2\lim_{x\to2}\frac{x^2 - 4}{x - 2} in X=R∖{2}X = \mathbb{R}\setminus\{2\}. The quotient law does not apply directly, because the denominator tends to 00. But on XX the function equals x+2x + 2, since x−2≠0x - 2 \neq 0 there and the factor cancels. The limit of x+2x + 2 as x→2x \to 2 is 44. The cancellation is legitimate because the limit never looks at x=2x = 2 itself: 22 is adherent to XX but not in it, and the definition only uses points of XX. This is the whole idea of a derivative (2A.10 Derivatives): a difference quotient is undefined at the point, and its limit is taken from nearby points only.

(b) Squeezing. xsin⁡(1/x)→0x\sin(1/x) \to 0 as x→0x \to 0 in X=R∖{0}X = \mathbb{R}\setminus\{0\}, because ∣xsin⁡(1/x)∣≤∣x∣|x\sin(1/x)| \leq |x|. The function sin⁡(1/x)\sin(1/x) has no limit at 00 (Example 9.16), but multiplying it by something that tends to 00 squeezes the oscillation flat. Bounded times small is small, as in the limit laws of 2A.6 Sequences.

(c) A trap with composition. If f(x)→Lf(x) \to L as x→x0x \to x_0, and gg is continuous at LL, then g(f(x))→g(L)g(f(x)) \to g(L). Continuity of gg at LL is needed, not just a limit of gg at LL. Let f(x)=0f(x) = 0 for all xx, and let g(y)=1g(y) = 1 for y≠0y \neq 0 and g(0)=0g(0) = 0. Then f(x)→0f(x) \to 0 and g(y)→1g(y) \to 1 as y→0y \to 0, but g(f(x))=0g(f(x)) = 0 for every xx, so g(f(x))→0g(f(x)) \to 0, not 11. The inner function sat exactly on the point where gg misbehaves. Limits can be passed through a function only where the function is continuous.

Definition 9.9 Continuity

A function f:X→Rf : X \to \mathbb{R} is continuous at x0∈Xx_0 \in X if f(x)→f(x0)f(x) \to f(x_0) as x→x0x \to x_0 in XX. That is,

∀ε>0  ∃δ>0  ∀x∈X: ∣x−x0∣<δ  ⟹  ∣f(x)−f(x0)∣≤ε.\forall \varepsilon > 0\ \ \exists \delta > 0\ \ \forall x \in X:\ |x - x_0| < \delta \implies |f(x) - f(x_0)| \leq \varepsilon.

It is continuous if it is continuous at every point of XX.

The definition reads as a tolerance contract (2A.5 Quantifiers and the Shape of a Proof): any output accuracy ε\varepsilon can be guaranteed by a sufficiently accurate input, δ\delta.

What the definition says, and what the picture says

The schoolbook picture of continuity is "a graph you can draw without lifting the pen". It is a good first guide, and it is worth seeing exactly where it parts company with the definition, because the definition is what the theorems use.

Continuity is local. The definition is about one point at a time: "ff is continuous at x0x_0" looks only at points within δ\delta of x0x_0, and δ\delta may be as small as you like. "ff is continuous" means continuous at each point separately. The pen picture, by contrast, is about the whole graph at once. A function can be continuous at one point and nowhere else.

Example 9.10 Continuous at exactly one point

Let f(x)=xf(x) = x for rational xx and f(x)=0f(x) = 0 for irrational xx. At x0=0x_0 = 0: for every xx, ∣f(x)−f(0)∣=∣f(x)∣≤∣x∣|f(x) - f(0)| = |f(x)| \leq |x|, so δ=ε\delta = \varepsilon works, and ff is continuous at 00. At any x0≠0x_0 \neq 0: there are rationals qn→x0q_n \to x_0 and irrationals rn→x0r_n \to x_0 (both are dense, 2A.4 The Real Numbers), and f(qn)=qn→x0f(q_n) = q_n \to x_0 while f(rn)=0f(r_n) = 0. The two limits differ, so by Proposition 9.11 ff is not continuous at x0x_0. Near 00 the graph is squeezed between the lines y=xy = x and y=0y = 0, and the squeeze forces continuity at the single point where they meet.

Stranger still is Thomae's function: f(x)=1qf(x) = \frac1q if x=pqx = \frac pq in lowest terms with q>0q > 0, and f(x)=0f(x) = 0 if xx is irrational. It is discontinuous at every rational and continuous at every irrational. At a rational pq\frac pq, irrationals arbitrarily close have value 0≠1q0 \neq \frac1q. At an irrational x0x_0, given ε>0\varepsilon > 0, only finitely many rationals in [x0−1,x0+1][x_0 - 1, x_0 + 1] have denominator q≤1εq \leq \frac1\varepsilon, and none of them is x0x_0; so a small enough interval around x0x_0 avoids them all, and on that interval ∣f(x)∣<ε|f(x)| < \varepsilon. No pen could draw this graph, and yet the definition says precisely where it is continuous. (The reverse, a function continuous exactly at the rationals, is impossible; that is a consequence of the Baire category theorem of 4A.2 Baire Category and Its Consequences.)

The domain matters. Continuity on a set XX only compares points of XX. The function 1x\frac1x is continuous on R∖{0}\mathbb{R}\setminus\{0\}, though its graph has two pieces; it is not "discontinuous at 00", because 00 is not in its domain. And the function that is 00 on (−∞,2)∩Q(-\infty, \sqrt2)\cap\mathbb{Q} and 11 on (2,∞)∩Q(\sqrt2, \infty)\cap\mathbb{Q} is continuous on Q\mathbb{Q}: every rational has a neighbourhood on which it is constant, because the jump happens at a point that is not in the domain. That is why the theorems of this chapter need intervals of real numbers: on Q\mathbb{Q}, a continuous function can jump.

The most useful equivalent form of continuity uses sequences.

Proposition 9.11 Sequential continuity

ff is continuous at x0x_0 if and only if f(xn)→f(x0)f(x_n) \to f(x_0) for every sequence (xn)(x_n) in XX converging to x0x_0.

Proof. (⇒) Given ε\varepsilon, take δ\delta from continuity, and NN with ∣xn−x0∣<δ|x_n - x_0| < \delta for n≥Nn \geq N. Then ∣f(xn)−f(x0)∣≤ε|f(x_n) - f(x_0)| \leq \varepsilon for n≥Nn \geq N.

(⇐) By contrapositive. If ff isn't continuous at x0x_0, negating the definition (2A.5 Quantifiers and the Shape of a Proof) gives an ε>0\varepsilon > 0 such that for every δ>0\delta > 0 some xx within δ\delta of x0x_0 has ∣f(x)−f(x0)∣>ε|f(x) - f(x_0)| > \varepsilon. Taking δ=1/n\delta = 1/n gives points xn→x0x_n \to x_0 with f(xn)f(x_n) staying ε\varepsilon away from f(x0)f(x_0).

The sequential form makes the algebra of continuous functions immediate from the limit laws of 2A.6 Sequences: sums, products and compositions of continuous functions are continuous, and so are quotients where the denominator is nonzero. Polynomials, rational functions, ∣x∣|x| and x\sqrt x are all continuous on their domains.

Proposition 9.12 Building continuous functions

Let f,g:X→Rf, g : X \to \mathbb{R} be continuous at x0x_0. Then f+gf + g, fgfg and cfcf are continuous at x0x_0, and so is f/gf/g if gg is nonzero on XX. If f:X→Yf : X \to Y is continuous at x0x_0 and h:Y→Rh : Y \to \mathbb{R} is continuous at f(x0)f(x_0), then h∘fh \circ f is continuous at x0x_0.

Proof. The first part is Corollary 9.7 with L=f(x0)L = f(x_0), M=g(x0)M = g(x_0). For the composition, let xn→x0x_n \to x_0 in XX. Then f(xn)→f(x0)f(x_n) \to f(x_0) by continuity of ff, and f(xn)f(x_n) is a sequence in YY, so h(f(xn))→h(f(x0))h(f(x_n)) \to h(f(x_0)) by continuity of hh. By Proposition 9.11, h∘fh \circ f is continuous at x0x_0.

So to see that a formula defines a continuous function, you rarely need ε\varepsilon and δ\delta. Constant functions and x↦xx \mapsto x are continuous (take δ=ε\delta = \varepsilon); hence, by sums and products, every polynomial; hence, by quotients, every rational function where its denominator is nonzero; and ∣x∣|x| is continuous because ∣∣x∣−∣x0∣∣≤∣x−x0∣\big||x| - |x_0|\big| \leq |x - x_0| (2A.3 Integers and Rationals). A function like 1+x2/(1+∣x∣)\sqrt{1 + x^2}/(1 + |x|) is then continuous by composition, products and quotients, with no computation.

Example 9.13 One ε–δ proof done by hand, for comparison

To see what the algebra above is saving, here is x2x^2 at a general point x0x_0, from the definition. Scratch work: ∣x2−x02∣=∣x−x0∣ ∣x+x0∣|x^2 - x_0^2| = |x - x_0|\,|x + x_0|. If ∣x−x0∣<1|x - x_0| < 1, then ∣x+x0∣≤∣x−x0∣+2∣x0∣<1+2∣x0∣|x + x_0| \leq |x - x_0| + 2|x_0| < 1 + 2|x_0|. So δ=min⁡(1,ε1+2∣x0∣)\delta = \min\big(1, \frac{\varepsilon}{1 + 2|x_0|}\big) works: for ∣x−x0∣<δ|x - x_0| < \delta, ∣x2−x02∣<δ(1+2∣x0∣)≤ε|x^2 - x_0^2| < \delta(1 + 2|x_0|) \leq \varepsilon. Notice that δ\delta depends on x0x_0, and shrinks as ∣x0∣|x_0| grows. That is no accident: x2x^2 is continuous on R\mathbb{R} but not uniformly continuous (2A.5 Quantifiers and the Shape of a Proof).

One-sided limits

At a jump, the function has a limit from each side but they differ. To talk about this, restrict the domain to one side.

Definition 9.14 One-sided limits

Let x0x_0 be adherent to X∩(x0,∞)X \cap (x_0, \infty). The right limit f(x0+)=lim⁡x→x0+f(x)f(x_0^+) = \lim_{x \to x_0^+} f(x) is the limit of ff as x→x0x \to x_0 in X∩(x0,∞)X \cap (x_0, \infty). The left limit f(x0−)f(x_0^-) is defined with X∩(−∞,x0)X \cap (-\infty, x_0).

Proposition 9.15 Continuity from both sides

Let x0∈Xx_0 \in X be adherent to both X∩(x0,∞)X \cap (x_0, \infty) and X∩(−∞,x0)X \cap (-\infty, x_0). Then ff is continuous at x0x_0 if and only if both one-sided limits exist and equal f(x0)f(x_0).

Proof. If ff is continuous at x0x_0, then restricting the condition "∣x−x0∣<δ  ⟹  ∣f(x)−f(x0)∣≤ε|x - x_0| < \delta \implies |f(x) - f(x_0)| \leq \varepsilon" to points on one side gives each one-sided limit. Conversely, given ε\varepsilon, choose δ+\delta_+ for the right limit and δ−\delta_- for the left limit, and let δ=min⁡(δ+,δ−)\delta = \min(\delta_+, \delta_-). A point xx with ∣x−x0∣<δ|x - x_0| < \delta is either to the right of x0x_0, to the left, or equal to it, and in each case ∣f(x)−f(x0)∣≤ε|f(x) - f(x_0)| \leq \varepsilon.

For the sign function of Example 9.16, sgn⁡(0−)=−1\operatorname{sgn}(0^-) = -1 and sgn⁡(0+)=1\operatorname{sgn}(0^+) = 1, so it is discontinuous at 00 whatever value is assigned there.

Example 9.16 Ways to be discontinuous
  • A jump. The sign function (−1-1 for x<0x < 0, 00 at 00, 11 for x>0x > 0) has different one-sided limits at 00: from the left −1-1, from the right 11.
  • A removable discontinuity. f(x)=sin⁡xxf(x) = \frac{\sin x}{x} for x≠0x \neq 0, with f(0)=0f(0) = 0, has lim⁡x→0f(x)=1≠f(0)\lim_{x\to 0} f(x) = 1 \neq f(0). Redefining f(0)=1f(0) = 1 repairs it.
  • Oscillation. sin⁡(1/x)\sin(1/x) has no limit at 00: along xn=12πnx_n = \frac{1}{2\pi n} it is 00, along xn=12πn+π/2x_n = \frac{1}{2\pi n + \pi/2} it is 11.
  • Everywhere. Dirichlet's function, 11 on rationals and 00 on irrationals, is discontinuous at every point, because every interval contains both kinds of number. It returns in 2A.11 The Riemann Integral as a function the Riemann integral can't handle.
Figure 9.1. Three kinds of discontinuity at 00: a jump (left and right limits differ), a removable one (the limit exists but disagrees with the value), and oscillation (no limit at all).

The maximum principle

Theorem 9.17 The maximum principle (extreme value theorem)

Let f:[a,b]→Rf : [a, b] \to \mathbb{R} be continuous. Then ff is bounded, and it attains its maximum and its minimum: there are points xmax⁡,xmin⁡∈[a,b]x_{\max}, x_{\min} \in [a, b] with f(xmin⁡)≤f(x)≤f(xmax⁡)f(x_{\min}) \leq f(x) \leq f(x_{\max}) for every x∈[a,b]x \in [a, b].

Proof (By contradiction and compactness). Bounded. This is the first instance of the contradiction–compactness template of 2A.5 Quantifiers and the Shape of a Proof. Suppose ff is not bounded above. Then for each nn there is xn∈[a,b]x_n \in [a, b] with f(xn)>nf(x_n) > n, a sequence of worse and worse counterexamples. By Heine–Borel some subsequence xnkx_{n_k} converges to a point x∈[a,b]x \in [a, b]. By continuity f(xnk)→f(x)f(x_{n_k}) \to f(x), a finite number; but f(xnk)>nk→∞f(x_{n_k}) > n_k \to \infty. Contradiction.

Attained. Let M=sup⁡x∈[a,b]f(x)M = \sup_{x \in [a,b]} f(x), finite by the first part. For each nn, M−1nM - \frac1n is not an upper bound, so there is xnx_n with f(xn)>M−1nf(x_n) > M - \frac1n. Again a subsequence converges to some x∈[a,b]x \in [a, b], and by continuity f(x)=lim⁡f(xnk)≥Mf(x) = \lim f(x_{n_k}) \geq M. Since also f(x)≤Mf(x) \leq M, we get f(x)=Mf(x) = M. The minimum is the same argument applied to −f-f.

It is worth seeing what each step of the proof needed. Continuity was used only at the single point xx where the subsequence lands: it is a local property, and the proof turns local information into a global conclusion. What made that possible is that the bad points xnx_n could not escape. Heine–Borel trapped a subsequence and delivered a limit inside [a,b][a, b], where continuity holds. So the proof has two ingredients, a local one (continuity) and a global one (compactness), and the theorem is exactly what you get by combining them. This division of labour is the pattern of every maximum principle in the guidebook: the equation gives local information at a maximum point, and compactness of the manifold guarantees there is a maximum point to look at.

Both conclusions fail without compactness. On the open interval (0,1](0, 1], the continuous function 1/x1/x is unbounded; on (0,1)(0, 1), the function f(x)=xf(x) = x is bounded but has no maximum, since it gets arbitrarily close to 11 without reaching it. On [0,∞)[0, \infty), f(x)=xf(x) = x is unbounded. And over the rationals, f(x)=−(x2−2)2f(x) = -(x^2 - 2)^2 on [1,2]∩Q[1, 2] \cap \mathbb{Q} has supremum 00, never attained, because 2\sqrt 2 is missing.

Figure 9.2. On a closed interval a continuous function attains its maximum and minimum (left). On an interval missing an endpoint the supremum may be approached but never reached (right): the open circle is not part of the graph.
In the world Model A best design exists, if the design space is compact

Engineering optimisation starts by asking whether an optimum exists at all, and the maximum principle is the basic tool for answering. Consider a cylindrical can that must hold a fixed volume VV. With radius rr and height h=V/(πr2)h = V/(\pi r^2), the metal used is proportional to its surface area

A(r)=2πr2+2Vr.A(r) = 2\pi r^2 + \frac{2V}{r}.

On (0,∞)(0, \infty) the maximum principle doesn't apply directly: the interval isn't closed and bounded. But A(r)→∞A(r) \to \infty both as r→0r \to 0 (tall thin cans) and as r→∞r \to \infty (flat wide ones). So any candidate for the minimum lies in some closed interval [r1,r2][r_1, r_2] outside which AA is larger than, say, A(1)A(1). On that compact interval a minimum exists. Calculus (2A.10 Derivatives) then locates it: A′(r)=4πr−2V/r2=0A'(r) = 4\pi r - 2V/r^2 = 0 at r=(V/2π)1/3r = (V/2\pi)^{1/3}, where h=2rh = 2r. The can of least surface area is as tall as it is wide. For V=330 cm3V = 330\ \text{cm}^3 that is r≈3.74r \approx 3.74 cm and h≈7.49h \approx 7.49 cm.

Real drinks cans are taller and narrower than this, because the model leaves things out: for instance, the ends of a can are typically made of thicker metal than its wall, which changes the cost to be minimised. The mathematical lesson stands. To prove a minimum exists, first trap it in a compact set, then use continuity. This is the direct method of the calculus of variations (4A.7 Weak Convergence and the Direct Method, 6A.11 Calculus of Variations and Gradient Flows), and the same move proves that Perelman's entropy has a minimiser (12A.3 The 𝓦-Entropy).

What a function looks like at its maximum

The maximum principle says that a maximum exists. The next chapter (2A.10 Derivatives) shows what happens at an interior maximum, but the fact is so central to this guidebook that it belongs here as a preview.

The idea At an interior maximum

If a differentiable function ff attains its maximum at a point x0x_0 inside the interval, then f′(x0)=0f'(x_0) = 0, and if ff is twice differentiable, f′′(x0)≤0f''(x_0) \leq 0: the graph is flat and bends down there. Every maximum principle for differential equations uses this. For the heat equation ∂tu=∂x2u\partial_t u = \partial_x^2 u on a closed interval, suppose the maximum of uu over space and time occurred for the first time at an interior point and a positive time. There ∂x2u≤0\partial_x^2 u \leq 0, but ∂tu≥0\partial_t u \geq 0, since uu has just risen to its maximum. With a little extra care this is impossible, and so a hot spot can never form spontaneously in the middle of a cooling rod (6A.5 Maximum Principles). Hamilton's maximum principle for Ricci flow (11A.7 Maximum Principles under Ricci Flow) runs the same argument for the curvature of a closed manifold, where a maximum is attained because the manifold is compact: the maximum principle of this chapter, one level up.

Figure 9.3. At an interior maximum the tangent is flat (f′=0f' = 0) and the graph bends down (f′′≤0f'' \leq 0). Right, a preview of 6A.5 Maximum Principles: the same observation, made in space and in time, forbids a new hot spot for the heat equation.

The intermediate value theorem

Theorem 9.18 Intermediate value theorem

Let f:[a,b]→Rf : [a, b] \to \mathbb{R} be continuous, and let yy be any number between f(a)f(a) and f(b)f(b). Then f(c)=yf(c) = y for some c∈[a,b]c \in [a, b].

Proof. We may assume f(a)<y<f(b)f(a) < y < f(b) (the case f(a)>y>f(b)f(a) > y > f(b) is the same with −f-f). Let E={x∈[a,b]:f(x)<y}E = \{x \in [a, b] : f(x) < y\}. It contains aa and is bounded by bb, so it has a supremum cc (2A.4 The Real Numbers). We show f(c)=yf(c) = y.

If f(c)<yf(c) < y: then c<bc < b, and by continuity f(x)<yf(x) < y for all xx in some interval [c,c+δ)[c, c + \delta), so points beyond cc belong to EE, contradicting that cc is an upper bound. If f(c)>yf(c) > y: then c>ac > a, and by continuity f(x)>yf(x) > y on some interval (c−δ,c](c - \delta, c], so no point of that interval lies in EE, and c−δc - \delta would be a smaller upper bound. So f(c)=yf(c) = y.

The proof uses the least upper bound property and nothing else. Over Q\mathbb{Q} the theorem fails: x2−2x^2 - 2 is negative at 11 and positive at 22 but has no rational zero (2A.3 Integers and Rationals). In a real sense, the intermediate value theorem is the completeness of the line, restated for functions.

Here is the "by continuity" step of the proof written out, since it is used again and again. Suppose f(c)<yf(c) < y, and let ε=y−f(c)>0\varepsilon = y - f(c) > 0. Continuity at cc gives δ>0\delta > 0 with ∣f(x)−f(c)∣<ε|f(x) - f(c)| < \varepsilon for ∣x−c∣<δ|x - c| < \delta, x∈[a,b]x \in [a, b]. For such xx, f(x)<f(c)+ε=yf(x) < f(c) + \varepsilon = y. So ff stays below yy near cc. In words: a continuous function that is strictly below a level at a point stays strictly below it nearby. Strict inequalities are "open" conditions, preserved under small changes of the input, just as non-strict ones are preserved under limits.

A second proof: bisection

The supremum proof is short but gives no way to find cc. Here is a proof that does, the bisection of 2A.6 Sequences turned into an argument. Suppose again f(a)<y<f(b)f(a) < y < f(b). Set a0=aa_0 = a and b0=bb_0 = b, and keep the invariant f(an)≤y≤f(bn)f(a_n) \leq y \leq f(b_n), which holds at the start. Let mm be the midpoint of [an,bn][a_n, b_n]. If f(m)≤yf(m) \leq y, set [an+1,bn+1]=[m,bn][a_{n+1}, b_{n+1}] = [m, b_n]; otherwise f(m)>yf(m) > y, and set [an+1,bn+1]=[an,m][a_{n+1}, b_{n+1}] = [a_n, m]. Either way the invariant survives and the length halves. The left endpoints increase and the right endpoints decrease, both bounded, so both converge (2A.6 Sequences), and since bn−an=b−a2n→0b_n - a_n = \frac{b - a}{2^n} \to 0 they converge to the same point c∈[a,b]c \in [a, b]. By continuity, f(an)→f(c)f(a_n) \to f(c) and f(bn)→f(c)f(b_n) \to f(c). Limits preserve non-strict inequalities, so f(c)≤yf(c) \leq y (from the ana_n) and f(c)≥yf(c) \geq y (from the bnb_n). Hence f(c)=yf(c) = y.

The two proofs use completeness in two of its interchangeable forms (2A.6 Sequences): the first through a supremum, the second through monotone convergence. The second is an algorithm, and after nn steps it knows cc to within b−a2n\frac{b - a}{2^n}, which is the error guarantee of the bisection method in every numerical library.

Intermediate values do not imply continuity. The converse of the theorem is false. The function f(x)=sin⁡(1/x)f(x) = \sin(1/x) for x≠0x \neq 0, with f(0)=0f(0) = 0, takes every value between any two of its values on any interval (near 00 it sweeps through all of [−1,1][-1, 1] infinitely often), but it is not continuous at 00 (Example 9.16). Having the intermediate value property is a weaker condition than continuity. It does hold for every derivative, continuous or not (Darboux's theorem, an exercise in 2A.10 Derivatives), which is one sign that derivatives are better behaved than arbitrary functions.

Corollary 9.19 The image of a closed interval

If f:[a,b]→Rf : [a, b] \to \mathbb{R} is continuous, then f([a,b])=[m,M]f([a, b]) = [m, M], where mm and MM are the minimum and maximum of ff.

Proof. By the maximum principle, m=f(xmin⁡)m = f(x_{\min}) and M=f(xmax⁡)M = f(x_{\max}) are values of ff, and every value lies between them. Applying the intermediate value theorem on the interval between xmin⁡x_{\min} and xmax⁡x_{\max}, every y∈[m,M]y \in [m, M] is a value of ff.

Example 9.20 Proving that equations have solutions

(a) Odd-degree polynomials have a real root. Let p(x)=xn+an−1xn−1+⋯+a0p(x) = x^n + a_{n-1}x^{n-1} + \cdots + a_0 with nn odd. For ∣x∣≥1|x| \geq 1,

∣an−1xn−1+⋯+a0∣≤(∣an−1∣+⋯+∣a0∣) ∣x∣n−1=C∣x∣n−1.|a_{n-1}x^{n-1} + \cdots + a_0| \leq (|a_{n-1}| + \cdots + |a_0|)\,|x|^{n-1} = C|x|^{n-1}.

If ∣x∣>max⁡(1,C)|x| > \max(1, C), this is less than ∣xn∣|x^n|, so p(x)p(x) has the sign of xnx^n, which is the sign of xx since nn is odd. Taking R>max⁡(1,C)R > \max(1, C), p(−R)<0<p(R)p(-R) < 0 < p(R), and the intermediate value theorem gives a root in [−R,R][-R, R]. (For even degree this fails: x2+1x^2 + 1 has no real root.)

(b) nn-th roots, again. For y>0y > 0, f(x)=xnf(x) = x^n is continuous on [0,1+y][0, 1 + y], with f(0)=0<yf(0) = 0 < y and f(1+y)≥1+y>yf(1 + y) \geq 1 + y > y. So some xx has xn=yx^n = y. This is a two-line proof of what took a page in 2A.4 The Real Numbers, because the hard work, extracting a solution from a supremum, now lives inside the intermediate value theorem.

(c) An equation with no algebraic solution. Does cos⁡x=x\cos x = x have a solution? With g(x)=cos⁡x−xg(x) = \cos x - x (taking the cosine as known for now; it is built in 2B.6 Power Series, Exponentials and Bump Functions), g(0)=1>0g(0) = 1 > 0 and g(π/2)=−π/2<0g(\pi/2) = -\pi/2 < 0, so yes, in (0,π/2)(0, \pi/2). Bisection (2A.6 Sequences) locates it: 0.7390851…0.7390851\ldots. No formula gives this number; the theorem guarantees it anyway.

In the world Model Two opposite points on the equator have the same temperature

At any instant, there are two diametrically opposite points on the equator with exactly the same temperature, provided temperature varies continuously along the equator. Measure position by the angle θ\theta and let T(θ)T(\theta) be the temperature. Consider

g(θ)=T(θ)−T(θ+π),g(\theta) = T(\theta) - T(\theta + \pi),

the difference between a point and its antipode. Then g(θ+π)=−g(θ)g(\theta + \pi) = -g(\theta). So either g(0)=0g(0) = 0 and we are done, or g(0)g(0) and g(π)g(\pi) have opposite signs, and by the intermediate value theorem gg vanishes somewhere between: there T(θ)=T(θ+π)T(\theta) = T(\theta + \pi). Nothing about weather was used except continuity. The same argument applies to air pressure, or altitude, along any great circle. In 7A.8 Smooth Topology a deeper theorem (Borsuk–Ulam) gives two antipodal points on the whole sphere at which temperature and pressure both agree.

Figure 9.4. g(θ)=T(θ)−T(θ+π)g(\theta) = T(\theta) - T(\theta + \pi) changes sign between 00 and π\pi, because g(θ+π)=−g(θ)g(\theta + \pi) = -g(\theta). By the intermediate value theorem it vanishes somewhere: two antipodal points with equal temperature. (The temperature profile here is illustrative; the conclusion holds for any continuous one.)
In the world Model The walker who returns

A walker sets off up a mountain path at 7 a.m. and reaches the summit at 5 p.m. The next morning she starts down the same path at 7 a.m. and is home by 5 p.m. Is there a point on the path that she passes at the same time of day on both days? Yes. Let u(t)u(t) and d(t)d(t) be her distances along the path at time tt on the up and down days. Then u(t)−d(t)u(t) - d(t) is continuous, negative at 7 a.m. and positive at 5 p.m., so it is zero at some moment. (Picture both days happening at once: two walkers on the same path, one going up and one coming down, must meet.)

Monotone functions and inverses

A function is increasing if x<yx < y implies f(x)≤f(y)f(x) \leq f(y), and strictly increasing if it implies f(x)<f(y)f(x) < f(y). Monotone functions are nearly continuous automatically: they can only have jump discontinuities, and only countably many of them (Exercise 9.27). A strictly monotone continuous function behaves especially well.

Proposition 9.21 Continuous inverses

If f:[a,b]→Rf : [a, b] \to \mathbb{R} is continuous and strictly increasing, then ff is a bijection from [a,b][a, b] onto [f(a),f(b)][f(a), f(b)], and its inverse is continuous and strictly increasing.

Surjectivity onto [f(a),f(b)][f(a), f(b)] is the intermediate value theorem, injectivity is strict monotonicity, and continuity of the inverse follows because an increasing function can only fail to be continuous by jumping, and the inverse can't jump over values its domain contains. This is how yn\sqrt[n]{y}, log⁡y\log y and arcsin⁡y\arcsin y get their continuity: as inverses of continuous, strictly monotone functions.

Proof. Bijective. If x<x′x < x' then f(x)<f(x′)f(x) < f(x'), so ff is injective. Its values lie in [f(a),f(b)][f(a), f(b)], and every yy there is a value by the intermediate value theorem. So f:[a,b]→[f(a),f(b)]f : [a, b] \to [f(a), f(b)] is a bijection; let gg be its inverse.

gg is strictly increasing. If y<y′y < y' but g(y)≥g(y′)g(y) \geq g(y'), then applying the increasing function ff gives y≥y′y \geq y', a contradiction.

gg is continuous. Let y0=f(x0)y_0 = f(x_0) and ε>0\varepsilon > 0. Let x−=max⁡(a,x0−ε)x_- = \max(a, x_0 - \varepsilon) and x+=min⁡(b,x0+ε)x_+ = \min(b, x_0 + \varepsilon). If yy lies in [f(x−),f(x+)][f(x_-), f(x_+)], then, gg being increasing, g(y)∈[x−,x+]⊆[x0−ε,x0+ε]g(y) \in [x_-, x_+] \subseteq [x_0 - \varepsilon, x_0 + \varepsilon]. It remains to see that every y∈[f(a),f(b)]y \in [f(a), f(b)] close enough to y0y_0 lies in [f(x−),f(x+)][f(x_-), f(x_+)]. If x0>ax_0 > a then x−<x0x_- < x_0 and f(x−)<y0f(x_-) < y_0; if x0=ax_0 = a, then f(x−)=y0=f(a)f(x_-) = y_0 = f(a) is the smallest value anyway. The same holds on the right. So it works to take δ\delta to be the smaller of the positive gaps y0−f(x−)y_0 - f(x_-) and f(x+)−y0f(x_+) - y_0, ignoring a gap that is zero because x0x_0 is an endpoint.

In the world In use Reading a sensor backwards

A thermistor is a resistor whose resistance changes strongly and monotonically with temperature. A digital thermometer measures resistance RR and must report the temperature TT with R=f(T)R = f(T), that is, evaluate f−1f^{-1}. Because ff is continuous and strictly monotone over the working range, the inverse exists and is continuous, so a small error in measuring RR causes only a small error in the reported TT. Manufacturers supply the curve ff as a fitted formula, such as the Steinhart–Hart equation (1968), or as a table. The firmware inverts it, often by the bisection of 2A.6 Sequences.

Uniform continuity

Continuity allows the input tolerance δ\delta to depend on the point. Uniform continuity asks for one δ\delta that works everywhere (2A.5 Quantifiers and the Shape of a Proof).

Definition 9.22 Uniform continuity

f:X→Rf : X \to \mathbb{R} is uniformly continuous if for every ε>0\varepsilon > 0 there is δ>0\delta > 0 such that ∣f(x)−f(y)∣≤ε|f(x) - f(y)| \leq \varepsilon for all x,y∈Xx, y \in X with ∣x−y∣<δ|x - y| < \delta.

f(x)=1/xf(x) = 1/x is continuous on (0,1](0, 1] but not uniformly continuous: near 00 the required δ\delta shrinks to zero (2A.5 Quantifiers and the Shape of a Proof). On [1,∞)[1, \infty) it is uniformly continuous, since ∣1/x−1/y∣=∣x−y∣/(xy)≤∣x−y∣|1/x - 1/y| = |x - y|/(xy) \leq |x - y| there. A cleaner sufficient condition:

Definition 9.23 Lipschitz functions

ff is Lipschitz with constant KK if ∣f(x)−f(y)∣≤K∣x−y∣|f(x) - f(y)| \leq K|x - y| for all x,yx, y. Lipschitz functions are uniformly continuous (take δ=ε/K\delta = \varepsilon/K).

The absolute value is Lipschitz with K=1K = 1, and so is max⁡(f,g)\max(f, g) whenever ff and gg are (Exercise 9.28), even though such a maximum may have corners where it isn't differentiable. That fact matters later. In Ricci flow one studies the maximum of the curvature over the manifold, M(t)=max⁡xF(x,t)M(t) = \max_x F(x, t), which is typically not differentiable in tt but is Lipschitz. Hamilton's trick (11A.7 Maximum Principles under Ricci Flow) is the observation that at almost every time its derivative is ∂tF\partial_t F evaluated at a point where the maximum is attained.

Theorem 9.24 Heine–Cantor

A continuous function on a closed bounded interval [a,b][a, b] is uniformly continuous.

Proof (By contradiction and compactness). Suppose not. Negating the definition: there is ε>0\varepsilon > 0 such that for every nn there are points xn,yn∈[a,b]x_n, y_n \in [a, b] with ∣xn−yn∣<1n|x_n - y_n| < \frac1n but ∣f(xn)−f(yn)∣>ε|f(x_n) - f(y_n)| > \varepsilon. By Heine–Borel a subsequence xnkx_{n_k} converges to some x∈[a,b]x \in [a, b], and then ynk→xy_{n_k} \to x too, since ∣xnk−ynk∣→0|x_{n_k} - y_{n_k}| \to 0. By continuity at xx, both f(xnk)f(x_{n_k}) and f(ynk)f(y_{n_k}) converge to f(x)f(x), so their difference tends to 00, contradicting ∣f(xnk)−f(ynk)∣>ε|f(x_{n_k}) - f(y_{n_k})| > \varepsilon.

The template again: assume the uniform statement fails, extract a sequence of counterexamples, use compactness to find a limit point, and get a contradiction from continuity there.

Measuring continuity: the modulus

Continuity and uniform continuity are yes-or-no properties. Analysis often needs a number instead: how continuous is the function? The answer is the modulus of continuity,

ωf(δ)=sup⁡{∣f(x)−f(y)∣:x,y∈X, ∣x−y∣≤δ},\omega_f(\delta) = \sup\{|f(x) - f(y)| : x, y \in X,\ |x - y| \leq \delta\},

the largest change in ff across any two points at distance at most δ\delta. By definition, ff is uniformly continuous exactly when ωf(δ)→0\omega_f(\delta) \to 0 as δ→0\delta \to 0, and the rate at which it tends to zero measures the quality of the continuity.

  • Lipschitz functions have ωf(δ)≤Kδ\omega_f(\delta) \leq K\delta: the output changes at most proportionally to the input.
  • Hölder continuous functions with exponent α∈(0,1]\alpha \in (0, 1] have ωf(δ)≤Kδα\omega_f(\delta) \leq K\delta^\alpha. The square root on [0,1][0, 1] is the basic example, with α=12\alpha = \frac12: for 0≤y≤x0 \leq y \leq x, (x−y)2≤(x−y)(x+y)=x−y(\sqrt x - \sqrt y)^2 \leq (\sqrt x - \sqrt y)(\sqrt x + \sqrt y) = x - y, so ∣x−y∣≤∣x−y∣|\sqrt x - \sqrt y| \leq \sqrt{|x - y|}. It is not Lipschitz, because near 00 it is infinitely steep: x−0x−0=1x\frac{\sqrt x - 0}{x - 0} = \frac{1}{\sqrt x} is unbounded. So x\sqrt x is uniformly continuous, Hölder with exponent 12\frac12, and not Lipschitz, a strict hierarchy in one example.
  • A continuous function on [a,b][a, b] always has some modulus tending to zero (Heine–Cantor), but it can tend to zero arbitrarily slowly.

Why care about the rate? Because estimates with rates survive limits, and estimates without them often do not. Hölder continuity is the currency of the regularity theory of partial differential equations: Schauder's estimates (6B.7 Schauder Theory and the Continuity Method) say that if the coefficients and data of an elliptic or parabolic equation are Hölder continuous, then so are the second derivatives of the solution, with a bound. Parabolic estimates of the same kind underlie short-time existence for the Ricci flow (11A.4 Short-Time Existence and Uniqueness). And a family of functions with a common modulus of continuity is the hypothesis of the Arzelà–Ascoli theorem (2B.5 Uniform Convergence and Arzelà–Ascoli), the compactness theorem for functions.

In the world In use Uniform continuity is what makes sampling safe

Digital audio records a continuous signal by sampling it at regular intervals, 44,100 times a second for a CD. Plotting software, lookup tables in engineering codes and graphics hardware all similarly replace a function by its values on a grid, joined by straight lines. When is that safe? If ff is uniformly continuous, then for any accuracy ε\varepsilon there is a spacing δ\delta, the same everywhere, such that ff varies by at most ε\varepsilon across each grid cell. Then the piecewise-linear interpolation through the samples is within ε\varepsilon of ff at every point (Exercise 9.29). For a function like sin⁡(1/x)\sin(1/x) near 00, no fixed spacing works: however fine the grid, there are cells near 00 in which the function swings from −1-1 to 11. Signal processing makes the same point quantitatively with the Nyquist–Shannon sampling theorem: a signal can be recovered from its samples only if it doesn't oscillate faster than the sampling rate can capture.

Figure 9.5. Left: for a uniformly continuous function, one grid spacing gives the same accuracy everywhere. Right: sin⁡(1/x)\sin(1/x) near 00 is continuous on (0,1](0, 1] but not uniformly continuous, and no fixed grid can follow it.

Limits at infinity

Finally, f(x)→Lf(x) \to L as x→+∞x \to +\infty means: for every ε>0\varepsilon > 0 there is MM with ∣f(x)−L∣≤ε|f(x) - L| \leq \varepsilon for all x>Mx > M. This is convergence of a sequence, with the index nn replaced by a real variable. All the limit laws carry over.

For example, 3x+1x−2→3\frac{3x + 1}{x - 2} \to 3 as x→+∞x \to +\infty: for x>2x > 2, ∣3x+1x−2−3∣=7x−2\big|\frac{3x+1}{x-2} - 3\big| = \frac{7}{x - 2}, which is at most ε\varepsilon once x≥2+7/εx \geq 2 + 7/\varepsilon. And the sequence criterion holds here too: f(x)→Lf(x) \to L as x→+∞x \to +\infty exactly when f(xn)→Lf(x_n) \to L for every sequence xn→+∞x_n \to +\infty. The can-design argument above used a limit at infinity, A(r)→+∞A(r) \to +\infty as r→+∞r \to +\infty, which means: for every KK there is MM with A(r)≥KA(r) \geq K for r>Mr > M.

Recall Where we stand

A function is continuous when it respects limits of sequences. On a closed bounded interval, continuous functions are bounded, attain their maximum and minimum (Tao's "maximum principle"), take every intermediate value, and are uniformly continuous. Each of these uses either the least upper bound property or Bolzano–Weierstrass, and fails over Q\mathbb{Q} or on open intervals. At an interior maximum the derivative vanishes and the second derivative is non-positive. 2A.10 Derivatives proves this, and builds differential calculus on it.

Exercises

Exercise 9.25 From the definition

Prove directly from the ε–δ definition that f(x)=xf(x) = \sqrt x is continuous on [0,∞)[0, \infty). (Hint: for x0>0x_0 > 0, ∣x−x0∣=∣x−x0∣x+x0≤∣x−x0∣x0|\sqrt x - \sqrt{x_0}| = \frac{|x - x_0|}{\sqrt x + \sqrt{x_0}} \leq \frac{|x - x_0|}{\sqrt{x_0}}; treat x0=0x_0 = 0 separately.) Is it uniformly continuous on [0,∞)[0, \infty)? Is it Lipschitz?

Solution

For x0>0x_0 > 0 take δ=εx0\delta = \varepsilon\sqrt{x_0}. At x0=0x_0 = 0, ∣x∣≤ε|\sqrt x| \leq \varepsilon when x<ε2x < \varepsilon^2. It is uniformly continuous on [0,∞)[0, \infty): ∣x−y∣≤∣x−y∣|\sqrt x - \sqrt y| \leq \sqrt{|x - y|} for all x,y≥0x, y \geq 0, so δ=ε2\delta = \varepsilon^2 works everywhere. It is not Lipschitz: x−0x−0=1x→∞\frac{\sqrt x - 0}{x - 0} = \frac{1}{\sqrt x} \to \infty as x→0x \to 0.

Exercise 9.26 A fixed point

Let f:[0,1]→[0,1]f : [0, 1] \to [0, 1] be continuous. Show that f(c)=cf(c) = c for some cc. (Apply the intermediate value theorem to f(x)−xf(x) - x.) This is the one-dimensional Brouwer fixed point theorem (7A.4 The Fundamental Group).

Solution

g(x)=f(x)−xg(x) = f(x) - x is continuous, g(0)=f(0)≥0g(0) = f(0) \geq 0 and g(1)=f(1)−1≤0g(1) = f(1) - 1 \leq 0, since ff takes values in [0,1][0, 1]. By the intermediate value theorem (with y=0y = 0, which lies between g(1)g(1) and g(0)g(0)), some cc has g(c)=0g(c) = 0.

Exercise 9.27 Monotone functions jump countably often

Let ff be increasing on R\mathbb{R}. Show that at each point the left and right limits exist, that ff is discontinuous exactly where they differ, and that this happens at only countably many points. (Hint: each jump contains a rational in the interval between the one-sided limits, and different jumps contain disjoint such intervals; use 2A.8 Infinite Sets.)

Solution

One-sided limits exist. For the left limit at x0x_0, let L=sup⁡{f(x):x<x0}L = \sup\{f(x) : x < x_0\}, finite because f(x)≤f(x0)f(x) \leq f(x_0) for x<x0x < x_0. Given ε\varepsilon, some x1<x0x_1 < x_0 has f(x1)>L−εf(x_1) > L - \varepsilon, and then for x1<x<x0x_1 < x < x_0, L−ε<f(x1)≤f(x)≤LL - \varepsilon < f(x_1) \leq f(x) \leq L. So f(x0−)=Lf(x_0^-) = L. Similarly f(x0+)=inf⁡{f(x):x>x0}f(x_0^+) = \inf\{f(x) : x > x_0\}. Both lie on the correct sides: f(x0−)≤f(x0)≤f(x0+)f(x_0^-) \leq f(x_0) \leq f(x_0^+).

Discontinuity means a jump. By Proposition 9.15, ff is continuous at x0x_0 exactly when f(x0−)=f(x0)=f(x0+)f(x_0^-) = f(x_0) = f(x_0^+), which, given the inequalities, means f(x0−)=f(x0+)f(x_0^-) = f(x_0^+).

Countably many jumps. At each discontinuity x0x_0, choose a rational q(x0)q(x_0) in the open interval (f(x0−),f(x0+))(f(x_0^-), f(x_0^+)). If x0<x1x_0 < x_1 are two discontinuities, then f(x0+)≤f(x1−)f(x_0^+) \leq f(x_1^-) (pick any xx between them: f(x0+)≤f(x)≤f(x1−)f(x_0^+) \leq f(x) \leq f(x_1^-)), so the two intervals are disjoint, and q(x0)≠q(x1)q(x_0) \neq q(x_1). So qq is an injection from the set of discontinuities into Q\mathbb{Q}, which is countable (2A.8 Infinite Sets). (Here the rational can be chosen by a rule, for instance the first rational in a fixed listing of Q\mathbb{Q} that lies in the interval, so no axiom of choice is needed.)

Exercise 9.28 The maximum of Lipschitz functions

Show that if ff and gg are Lipschitz with constant KK, so is h=max⁡(f,g)h = \max(f, g). Give an example where ff and gg are differentiable everywhere but hh is not.

Solution

For any x,yx, y: h(x)−h(y)≤h(x) - h(y) \leq (the one of f(x),g(x)f(x), g(x) that is larger) minus (the same function at yy) ≤K∣x−y∣\leq K|x - y|, since h(y)h(y) is at least either function's value at yy; by symmetry ∣h(x)−h(y)∣≤K∣x−y∣|h(x) - h(y)| \leq K|x - y|. Example: f(x)=xf(x) = x, g(x)=−xg(x) = -x, h(x)=∣x∣h(x) = |x|, which has a corner at 00.

Exercise 9.29 Interpolation error

Suppose ∣f(x)−f(y)∣≤ε|f(x) - f(y)| \leq \varepsilon whenever ∣x−y∣≤δ|x - y| \leq \delta. Let LL be the piecewise-linear function that agrees with ff at the grid points xk=a+kδx_k = a + k\delta. Show that ∣f(x)−L(x)∣≤2ε|f(x) - L(x)| \leq 2\varepsilon for every xx. (Can you improve this to ε\varepsilon?)

Solution

Let x∈[xk,xk+1]x \in [x_k, x_{k+1}]. On this cell LL is a weighted average of f(xk)f(x_k) and f(xk+1)f(x_{k+1}), so L(x)L(x) lies between them. Both are within ε\varepsilon of f(x)f(x), since ∣x−xk∣≤δ|x - x_k| \leq \delta and ∣x−xk+1∣≤δ|x - x_{k+1}| \leq \delta. A number between two numbers that are both within ε\varepsilon of f(x)f(x) is itself within ε\varepsilon of f(x)f(x). So in fact ∣f(x)−L(x)∣≤ε|f(x) - L(x)| \leq \varepsilon: the improvement holds. (The bound 2ε2\varepsilon comes from the cruder estimate ∣f(x)−L(x)∣≤∣f(x)−f(xk)∣+∣f(xk)−L(x)∣|f(x) - L(x)| \leq |f(x) - f(x_k)| + |f(x_k) - L(x)|, with ∣f(xk)−L(x)∣≤∣f(xk)−f(xk+1)∣≤ε|f(x_k) - L(x)| \leq |f(x_k) - f(x_{k+1})| \leq \varepsilon.)

Exercise 9.30 Where the hypotheses matter

For each statement, find a function showing it fails if one hypothesis is removed: (a) the maximum principle without continuity; (b) the maximum principle on [0,∞)[0, \infty); (c) the intermediate value theorem without continuity; (d) Heine–Cantor on (0,1)(0, 1).

Solution

(a) f(x)=xf(x) = x for x<1x < 1 and f(1)=0f(1) = 0, on [0,1][0, 1]: the supremum 11 is not attained. Or f(x)=1/xf(x) = 1/x for x>0x > 0, f(0)=0f(0) = 0: unbounded. (b) f(x)=xf(x) = x on [0,∞)[0, \infty) is unbounded; f(x)=x/(1+x)f(x) = x/(1 + x) is bounded with supremum 11 not attained. (c) The sign function on [−1,1][-1, 1] takes the values −1-1 and 11 but never 12\frac12. (d) f(x)=1/xf(x) = 1/x on (0,1)(0, 1), or sin⁡(1/x)\sin(1/x).

Exercise 9.31 Closed sets from continuous functions

Let f:R→Rf : \mathbb{R} \to \mathbb{R} be continuous. Show that {x:f(x)≤0}\{x : f(x) \leq 0\} and {x:f(x)=0}\{x : f(x) = 0\} are closed. Is {x:f(x)<0}\{x : f(x) < 0\} closed?

Solution

If f(xn)≤0f(x_n) \leq 0 and xn→xx_n \to x, then f(xn)→f(x)f(x_n) \to f(x) by continuity, and f(x)≤0f(x) \leq 0 because limits preserve ≤\leq. By Proposition 9.2 the set is closed. The zero set is the intersection of {f≤0}\{f \leq 0\} and {−f≤0}\{-f \leq 0\}; or argue the same way with ==. The set {f<0}\{f < 0\} is usually not closed: for f(x)=xf(x) = x it is (−∞,0)(-\infty, 0), whose closure contains 00.

Exercise 9.32 A continuous function is determined by its values on the rationals

Let f,g:R→Rf, g : \mathbb{R} \to \mathbb{R} be continuous with f(q)=g(q)f(q) = g(q) for every rational qq. Prove that f=gf = g.

Solution

Let x∈Rx \in \mathbb{R}. By density of Q\mathbb{Q} (2A.4 The Real Numbers) choose rationals qnq_n with ∣qn−x∣<1n|q_n - x| < \frac1n, so qn→xq_n \to x. By continuity, f(x)=lim⁡f(qn)=lim⁡g(qn)=g(x)f(x) = \lim f(q_n) = \lim g(q_n) = g(x).

Exercise 9.33 Continuous additive functions are linear

Let f:R→Rf : \mathbb{R} \to \mathbb{R} be continuous with f(x+y)=f(x)+f(y)f(x + y) = f(x) + f(y) for all x,yx, y. Prove that f(x)=cxf(x) = cx for every xx, where c=f(1)c = f(1). (Show in turn: f(0)=0f(0) = 0; f(nx)=nf(x)f(nx) = nf(x) for natural nn; f(−x)=−f(x)f(-x) = -f(x); f(p/q)=cp/qf(p/q) = cp/q; then use Exercise 9.32.)

Solution

f(0)=f(0+0)=2f(0)f(0) = f(0 + 0) = 2f(0), so f(0)=0f(0) = 0. By induction f(nx)=f((n−1)x)+f(x)=nf(x)f(nx) = f((n-1)x) + f(x) = nf(x). Then 0=f(x+(−x))=f(x)+f(−x)0 = f(x + (-x)) = f(x) + f(-x). For q>0q > 0, qf(p/q)=f(p)=pf(1)=pcqf(p/q) = f(p) = pf(1) = pc, so f(p/q)=cp/qf(p/q) = cp/q; negatives follow from f(−x)=−f(x)f(-x) = -f(x). So ff and x↦cxx \mapsto cx are continuous and agree on Q\mathbb{Q}, hence everywhere. (Without continuity there are wild additive functions, built with a basis of R\mathbb{R} over Q\mathbb{Q} from 2A.8 Infinite Sets; they are discontinuous everywhere.)

Exercise 9.34 Rehearsal: a uniform lower bound

Let ff be continuous and strictly positive on [a,b][a, b]. Prove, by the contradiction–compactness template, that there is c>0c > 0 with f(x)≥cf(x) \geq c for all x∈[a,b]x \in [a, b]. Then show the conclusion fails for f(x)=xf(x) = x on (0,1](0, 1]. A uniform positive lower bound obtained from compactness is exactly the kind of statement used, for instance, to bound below the injectivity radius of a compact Riemannian manifold (9A.3 Geodesics and the Exponential Map), and its failure without compactness is what collapsing means (9B.3 Collapsing and Noncollapsing).

Solution

Suppose not: for each nn there is xnx_n with f(xn)<1/nf(x_n) < 1/n. A subsequence converges to some x∈[a,b]x \in [a, b], and by continuity f(x)=lim⁡f(xnk)≤0f(x) = \lim f(x_{n_k}) \leq 0, contradicting f(x)>0f(x) > 0. (Alternatively: ff attains its minimum, which is positive.) On (0,1](0, 1], f(x)=xf(x) = x is positive but inf⁡f=0\inf f = 0.

Free resources for this chapter

Chosen for what this chapter covers, and all free to read or watch. Where a lecture covers more than this chapter, the minutes to watch are given, and the link starts there when it can. Links checked Nov 6, 2026.

Read

Watch 3 lectures and talks

© 2026 Neckpinch (www.neckpinch.com). All content in the guidebook (text, mathematics, figures and exercises) is protected by copyright. All rights reserved. No part may be copied, republished or redistributed without written permission.