7  Continuity

7.1 Continuous Functions

The previous chapter asked what a function does far out on the line. This chapter returns to a finite point and asks the question limits were built to answer: when does the limit equal the value? A function with that property at every point is one you can draw without lifting the pencil. That picture is a good guide and a bad definition, because it cannot prove anything. The \(\varepsilon\)–\(\delta\) version can, and it turns out to have three large consequences.

  • A continuous function on an interval cannot skip a value (the Intermediate Value Theorem).
  • A continuous function on a closed bounded interval attains a maximum and a minimum (the Extreme Value Theorem).
  • A continuous function on a closed bounded interval can be controlled by a single \(\delta\) for each \(\varepsilon\), uniformly over the interval (uniform continuity).

The last one has a stronger relative, Lipschitz continuity, which bounds the steepness of the graph. It is the bridge to derivatives.

All three consequences fail over the rationals. They depend on the completeness of \(\mathbb{R}\), the same property that made the Monotone Convergence Theorem work, and the proofs will use it in the same way.

7.2 Continuity at a Point

Definition 7.1 (Continuity at a Point) Let \(f : E \to \mathbb{R}\) and \(a \in E\). We say \(f\) is continuous at \(a\) if for every \(\varepsilon > 0\) there is a \(\delta > 0\) such that \[ x \in E \quad\text{and}\quad |x - a| < \delta \qquad\Longrightarrow\qquad |f(x) - f(a)| < \varepsilon. \]

Compare this with the definition of \(\lim_{x \to a} f(x) = L\). Two things changed. The number \(L\) became \(f(a)\), and the condition \(0 < |x - a|\) became \(|x - a|\). The second change is harmless: at \(x = a\) the conclusion reads \(0 < \varepsilon\), which is always true. So for a limit point \(a\) of \(E\), \[ f \text{ is continuous at } a \iff \lim_{x \to a} f(x) = f(a), \] and at an isolated point of \(E\) every function is continuous, since no other \(x\) is near enough to cause trouble. Continuity is three requirements at once: \(f(a)\) is defined, the limit exists, and the two agree.

Example 1. \(f(x) = x^2\) is continuous at every \(a \in \mathbb{R}\).

Scratch work. \(|x^2 - a^2| = |x - a|\,|x + a|\). The factor \(|x-a|\) is the one we control. If \(|x - a| < 1\), then \(|x + a| \le |x - a| + 2|a| < 2|a| + 1\). So we need \(|x - a| < \varepsilon/(2|a|+1)\) as well, and \(\delta = \min\!\big(1, \varepsilon/(2|a|+1)\big)\).

Let \(\varepsilon > 0\) and \(\delta = \min\!\big(1, \varepsilon/(2|a|+1)\big)\). If \(|x - a| < \delta\), then \(|x + a| < 2|a| + 1\), so \[ |x^2 - a^2| = |x - a|\,|x + a| < \frac{\varepsilon}{2|a|+1}\,(2|a|+1) = \varepsilon. \qquad \square \]

As a check, for \(a = 2\) and \(\varepsilon = 0.5\) this gives \(\delta = \min(1, 0.1) = 0.1\), as in the previous chapter. Notice that \(\delta\) depends on \(a\) as well as on \(\varepsilon\): the farther out we are, the smaller it must be. We will come back to this, because it is the key to the last third of the chapter.

7.2.1 What Can Go Wrong

A function is discontinuous at \(a \in E\) when one of the three requirements fails. There are four typical ways.

Type What happens at \(a\) Example
Removable the limit exists but differs from \(f(a)\) \(\frac{\sin x}{x}\) with \(f(0) = 2\)
Jump the one-sided limits exist and differ Heaviside function at \(0\)
Infinite \(f(x) \to \pm\infty\) from at least one side \(\frac1x\) with \(f(0) = 0\)
Oscillating a one-sided limit fails to exist \(\sin\frac1x\) with \(f(0) = 0\)

A 2 by 2 grid showing the four types of discontinuity at x = 0. Top left, removable: sin(x)/x approaches height 1 but the function value is a red dot at 2. Top right, jump: height 0 to the left and height 1 to the right. Bottom left, infinite: 1/x runs off to plus and minus infinity with a red dot at 0. Bottom right, oscillating: sin(1/x) oscillates faster and faster near 0 with a red dot at 0.

Only the first type is repairable. Redefining \(f(a)\) to equal the limit removes the discontinuity, which is why it is called removable. In the other three, no choice of \(f(a)\) can help.

By Theorem 4.5, continuity at \(a\) is also equivalent to \(\lim_{x\to a^-} f(x) = f(a) = \lim_{x\to a^+} f(x)\), which is how piecewise functions are checked.

Example 2. Let \(f(x) = x^2\) for \(x < 1\) and \(f(x) = 2x - 1\) for \(x \ge 1\). Then \(f(1) = 1\), \(\lim_{x\to 1^-} x^2 = 1\) and \(\lim_{x \to 1^+}(2x - 1) = 1\), so \(f\) is continuous at \(1\). Away from \(1\), \(f\) agrees with a polynomial on a neighborhood, so it is continuous there too. Now change the value at \(1\) to \(3\). The one-sided limits are still both \(1\), but \(f(1) = 3\) breaks the third requirement: a removable discontinuity.

7.3 The Sequential Characterization

Continuity says that \(f(x)\) stays close to \(f(a)\) when \(x\) is close to \(a\). Closeness can also be expressed with sequences: if \(x_n \to a\), then \(f(x_n)\) should approach \(f(a)\).

Theorem 7.1 (Sequential Formulation of Continuity) Let \(f : E \to \mathbb{R}\) and \(a \in E\). Then \(f\) is continuous at \(a\) if and only if for every sequence \((x_n)\) in \(E\) with \(x_n \to a\), we have \(f(x_n) \to f(a)\).

The forward direction is a translation of \(\delta\) into \(N\). The backward direction is proved by contrapositive: if continuity fails, the failure hands us a bad sequence.

(\(\Rightarrow\)) Let \(\varepsilon > 0\) and choose \(\delta\) from the definition. Since \(x_n \to a\), there is an \(N\) with \(|x_n - a| < \delta\) for \(n \ge N\), and for those \(n\), \(|f(x_n) - f(a)| < \varepsilon\).

(\(\Leftarrow\)) Suppose \(f\) is not continuous at \(a\). Then there is an \(\varepsilon_0 > 0\) such that for every \(\delta > 0\) some \(x \in E\) has \(|x - a| < \delta\) and \(|f(x) - f(a)| \ge \varepsilon_0\). Taking \(\delta = 1/n\) gives points \(x_n\) with \(x_n \to a\) and \(|f(x_n) - f(a)| \ge \varepsilon_0\) for all \(n\), so \(f(x_n) \not\to f(a)\). \(\square\)

As in the previous chapters, the criterion has a second use: to show a function is discontinuous, exhibit one sequence that misbehaves.

Example 3. The Dirichlet function \[ \chi_{\mathbb{Q}}(x) = \begin{cases} 1 & x \in \mathbb{Q}, \\ 0 & x \notin \mathbb{Q} \end{cases} \] is discontinuous at every point of \(\mathbb{R}\).

Fix \(a \in \mathbb{R}\). Every interval contains both rational and irrational numbers, so we can pick rationals \(q_n\) and irrationals \(r_n\) with \(|q_n - a| < 1/n\) and \(|r_n - a| < 1/n\). Both sequences converge to \(a\), but \(\chi_{\mathbb{Q}}(q_n) = 1\) and \(\chi_{\mathbb{Q}}(r_n) = 0\) for every \(n\). They cannot both converge to \(\chi_{\mathbb{Q}}(a)\). \(\square\)

No picture of \(\chi_{\mathbb{Q}}\) can be drawn, and this is the point of having a definition rather than an image.

7.4 Building Continuous Functions

Continuity at \(a\) is a limit statement, so the limit laws carry it through arithmetic.

Theorem 7.2 (Algebra of Continuous Functions) Let \(f\) and \(g\) be continuous at \(a\). Then \(f \pm g\), \(cf\) for \(c \in \mathbb{R}\), and \(fg\) are continuous at \(a\). If \(g(a) \ne 0\), then \(f/g\) is continuous at \(a\). If \(g\) is continuous at \(a\) and \(f\) is continuous at \(g(a)\), then \(f \circ g\) is continuous at \(a\).

The first part is the limit laws with \(L = f(a)\) and \(M = g(a)\). For composition, the proof is a relay: the tolerance for \(f\) becomes the target for \(g\).

If \(a\) is an isolated point of the domain there is nothing to prove, so let \(a\) be a limit point. By Theorem 4.3, \(f(x) \pm g(x) \to f(a) \pm g(a)\), \(c f(x) \to c f(a)\) and \(f(x)g(x) \to f(a)g(a)\), and if \(g(a) \ne 0\) then \(f(x)/g(x) \to f(a)/g(a)\). Each limit equals the value of the combined function at \(a\).

For composition, let \(\varepsilon > 0\). Continuity of \(f\) at \(g(a)\) gives \(\eta > 0\) with \(|y - g(a)| < \eta \Rightarrow |f(y) - f(g(a))| < \varepsilon\). Continuity of \(g\) at \(a\) gives \(\delta > 0\) with \(|x - a| < \delta \Rightarrow |g(x) - g(a)| < \eta\). Chaining the two, \(|x - a| < \delta\) gives \(|f(g(x)) - f(g(a))| < \varepsilon\). \(\square\)

Constants and \(f(x) = x\) are continuous, so polynomials are continuous on \(\mathbb{R}\), and rational functions are continuous wherever the denominator is nonzero. Sine and cosine are continuous on \(\mathbb{R}\) (we prove this shortly, as a by-product of Lipschitz continuity), and \(\sqrt{\ \cdot\ }\) is continuous on \([0, \infty)\) by Lemma 5.3. The exponential and the logarithm are continuous on their domains, a fact that comes with their definitions in the Differentiation part. Compositions and combinations of these are continuous on their natural domains.

Example 4. Where is \(k(x) = \sqrt{\dfrac{x+1}{x-3}}\) continuous?

The rational function \(r(x) = \frac{x+1}{x-3}\) is continuous for \(x \ne 3\), and \(\sqrt{\ \cdot\ }\) is continuous on \([0,\infty)\). So \(k\) is continuous wherever \(x \ne 3\) and \(r(x) \ge 0\). The quotient is nonnegative when numerator and denominator have the same sign (or the numerator vanishes), which happens on \((-\infty, -1] \cup (3, \infty)\). That is the domain of \(k\), and \(k\) is continuous on all of it.

The verification by decomposition is the whole point of the theorem. We never return to \(\varepsilon\) and \(\delta\) for a new function once it is built from pieces we already trust.

Definition 7.2 (Continuity on a Set) A function \(f : E \to \mathbb{R}\) is continuous on \(E\) if it is continuous at every point of \(E\).

7.5 The Intermediate Value Theorem

If a continuous function starts below a level and ends above it, it must cross that level.

Theorem 7.3 (Intermediate Value Theorem) Let \(f : [a, b] \to \mathbb{R}\) be continuous. If \(y\) lies strictly between \(f(a)\) and \(f(b)\), then there is a \(c \in (a, b)\) with \(f(c) = y\).

Intermediate Value Theorem

The picture makes the theorem look obvious, and it is not. Take \(f(x) = x^2 - 2\) on the rational numbers. Then \(f(1) = -1 < 0 < 2 = f(2)\), yet no rational \(c\) satisfies \(f(c) = 0\), since \(\sqrt2\) is irrational. The rationals have gaps and a function can slip through them. The proof must use the gaplessness of \(\mathbb{R}\), and it does so through the least upper bound property.

The idea: collect all the points where \(f\) is still below \(y\), and look at the last one.

Suppose \(f(a) < y < f(b)\). (Otherwise apply the argument to \(-f\) and \(-y\).) Let \[ S = \{x \in [a,b] : f(x) < y\}. \] Then \(a \in S\) and \(S\) is bounded above by \(b\), so \(c = \sup S\) exists and \(c \in [a, b]\). We show \(f(c) = y\) by ruling out the other two possibilities.

Suppose \(f(c) < y\). Then \(c < b\), since \(f(b) > y\). Applying continuity at \(c\) with \(\varepsilon = y - f(c)\) gives a \(\delta > 0\) such that \(f(x) < y\) for all \(x \in [a,b]\) with \(|x - c| < \delta\). The point \(x = \min(c + \delta/2,\, b)\) is in \([a,b]\), is larger than \(c\), and lies in \(S\). That contradicts \(c\) being an upper bound of \(S\).

Suppose \(f(c) > y\). Then \(c > a\), since \(f(a) < y\). Continuity with \(\varepsilon = f(c) - y\) gives a \(\delta > 0\) such that \(f(x) > y\) for all \(x \in [a,b]\) with \(|x - c| < \delta\). So no point of \(S\) lies in \((c - \delta, c]\), and none lie above \(c\). Every element of \(S\) is therefore at most \(c - \delta\), so \(c - \delta\) is a smaller upper bound than \(c\), contradicting that \(c\) is the least one.

Hence \(f(c) = y\), and \(c \ne a, b\) because \(f(a) < y < f(b)\). \(\square\)

7.5.1 Roots and Bisection

The most common use is to find roots. If \(f\) is continuous on \([a,b]\) and \(f(a)\), \(f(b)\) have opposite signs, then \(f\) has a root in \((a,b)\).

Example 5. \(p(x) = x^5 - 3x + 1\) has a root in \((0,1)\), since \(p(0) = 1 > 0\) and \(p(1) = -1 < 0\). It has no obvious formula for its roots, but we now know one exists.

The theorem also gives an algorithm. Evaluate \(f\) at the midpoint of an interval where the sign changes, keep the half where it still changes, and repeat. For \(f(x) = \cos x - x\) on \([0, 1]\), where \(f(0) = 1 > 0\) and \(f(1) < 0\):

Step Midpoint Sign of \(f\) New interval
1 \(0.5\) \(+\) \([0.5,\ 1]\)
2 \(0.75\) \(-\) \([0.5,\ 0.75]\)
3 \(0.625\) \(+\) \([0.625,\ 0.75]\)
4 \(0.6875\) \(+\) \([0.6875,\ 0.75]\)

Each step halves the interval, so after \(n\) steps the root is trapped in an interval of length \(2^{-n}\). Twenty steps give six correct decimals. The root is \(0.7390\ldots\).

The idea behind the proof, with nested intervals

7.5.2 Fixed Points

Theorem 7.4 (Fixed Point Theorem in One Dimension) If \(f : [a,b] \to [a,b]\) is continuous, then there is a \(c \in [a,b]\) with \(f(c) = c\).

Let \(g(x) = f(x) - x\), which is continuous. Since \(f(a) \in [a,b]\), \(g(a) = f(a) - a \ge 0\), and since \(f(b) \le b\), \(g(b) = f(b) - b \le 0\). If either is \(0\) we have a fixed point at an endpoint. Otherwise \(g(a) > 0 > g(b)\) and Theorem 7.3 gives \(c \in (a,b)\) with \(g(c) = 0\). \(\square\)

Fixed Point Theorem

The theorem says that the graph of any continuous self-map of \([a,b]\) crosses the diagonal. This is the one-dimensional case of a theorem (Brouwer’s) that holds in every dimension.

7.5.3 What the Theorem Does Not Say

Each hypothesis matters. Without continuity, the Heaviside function takes the values \(0\) and \(1\) on \([-1, 1]\) and nothing in between. Without an interval, \(f(x) = 1/x\) on \([-1,1]\setminus\{0\}\) is continuous, with \(f(-1) = -1\) and \(f(1) = 1\), yet never equals \(0\).

The converse also fails: a function can take every intermediate value without being continuous. Let \(f(x) = \sin(1/x)\) for \(x \ne 0\) and \(f(0) = 0\). It takes every value in \([-1,1]\) on any interval containing \(0\), yet it is discontinuous at \(0\). So the intermediate value property is a consequence of continuity, not a replacement for it.

7.6 The Extreme Value Theorem

Look at \(x^2\) on \([0, 2]\). It has a minimum at \(0\) and a maximum at \(2\). On the open interval \((0, 2)\) it has neither. The function \(1/x\) on \((0, 1]\) is continuous but has no maximum, since it grows without bound near \(0\). A closed bounded interval removes both escape routes.

Theorem 7.5 (Extreme Value Theorem) Let \(f : [a, b] \to \mathbb{R}\) be continuous. Then there are \(c, d \in [a,b]\) with \[ f(c) \le f(x) \le f(d) \qquad \text{for all } x \in [a,b]. \]

The proof needs one tool that we have not yet established: a way to extract a convergent sequence from points trapped in \([a,b]\).

Lemma 7.1 (Bolzano–Weierstrass) Every bounded sequence has a convergent subsequence.

We first show every sequence has a monotone subsequence, and then use Theorem 3.6.

Call an index \(n\) a peak if \(x_n \ge x_m\) for all \(m > n\). If there are infinitely many peaks, the sequence along them is nonincreasing. If there are finitely many, take \(n_1\) beyond the last peak. Since \(n_1\) is not a peak, some \(n_2 > n_1\) has \(x_{n_2} > x_{n_1}\), and \(n_2\) is not a peak either, so some \(n_3 > n_2\) has \(x_{n_3} > x_{n_2}\), and so on. This gives an increasing subsequence. In both cases the monotone subsequence is bounded, so it converges by Theorem 3.6. \(\square\)

If the sequence lies in \([a,b]\), the limit does too, by Theorem 3.4. Now the theorem.

Bounded. Suppose \(f\) is unbounded above. Pick \(x_n \in [a,b]\) with \(f(x_n) > n\). By Lemma 7.1, some subsequence \(x_{n_k}\) converges to a point \(c \in [a,b]\). Continuity at \(c\) gives \(f(x_{n_k}) \to f(c)\), so the subsequence is bounded, contradicting \(f(x_{n_k}) > n_k \to \infty\). The same argument applies from below.

Attained. Since \(f\) is bounded above, \(M = \sup f([a,b])\) exists. For each \(n\) choose \(x_n \in [a,b]\) with \(M - \tfrac1n < f(x_n) \le M\). By Lemma 7.1 a subsequence \(x_{n_k} \to d \in [a,b]\). By continuity \(f(x_{n_k}) \to f(d)\), and by the squeeze \(f(x_{n_k}) \to M\). So \(f(d) = M\). The minimum is the same argument applied to \(-f\). \(\square\)

Together with Theorem 7.3, the Extreme Value Theorem describes the image completely: if \(m\) and \(M\) are the minimum and maximum, then \(f([a,b]) = [m, M]\). A continuous function maps a closed bounded interval onto a closed bounded interval.

Each hypothesis is needed. On \([0,1]\), the function equal to \(x\) for \(x < 1\) and \(0\) at \(x = 1\) has supremum \(1\) that is never attained: continuity fails at one point. On the open interval \((0,1)\), \(x^2\) has neither a maximum nor a minimum: the endpoints are missing. On \([0,\infty)\), \(f(x) = x\) has no maximum: the interval is unbounded. And over \(\mathbb{Q}\) the theorem fails too: \(\frac{1}{x^2 - 2}\) is continuous and unbounded on the rationals in \([0,2]\).

Example 6. The range of a projectile launched at speed \(v_0\) and angle \(\theta \in [0, \pi/2]\) is \(R(\theta) = \frac{v_0^2}{g}\sin 2\theta\). The function is continuous on a closed bounded interval, so a best angle exists. (Here we can see it directly, since \(\sin 2\theta \le 1\) with equality at \(\theta = \pi/4\). In general the theorem tells us that an optimum exists before we know how to find it, which is the starting point of Section 14.1.)

7.7 Uniform Continuity

Return to Example 1. To prove that \(x^2\) is continuous at \(a\), we needed \(\delta = \min\!\big(1, \varepsilon/(2|a|+1)\big)\), which shrinks as \(|a|\) grows. Written with all quantifiers, continuity on \(E\) says \[ \forall\,\varepsilon > 0\ \ \forall\, a \in E\ \ \exists\,\delta > 0\ \ \forall x \in E:\quad |x - a| < \delta \Rightarrow |f(x) - f(a)| < \varepsilon. \] Here \(\delta\) is chosen after \(a\), so it may depend on it. What if a single \(\delta\) could serve every point at once?

Definition 7.3 (Uniform Continuity) A function \(f : E \to \mathbb{R}\) is uniformly continuous on \(E\) if for every \(\varepsilon > 0\) there is a \(\delta > 0\) such that \[ x, y \in E \quad\text{and}\quad |x - y| < \delta \qquad\Longrightarrow\qquad |f(x) - f(y)| < \varepsilon. \]

The only change from continuity is the order of quantifiers: \(\delta\) now comes before the points, so it depends on \(\varepsilon\) alone. In the picture below, each box has width \(2\delta\) and height \(2\varepsilon\), centered on a point of the graph. For \(x^2\), the box that fits at \(a\) gets narrower as \(a\) increases. For \(\sin x\), the same box fits everywhere.

Uniform Continuity

To show that a function is not uniformly continuous we negate the definition. The negation is as usable as the sequential criterion before it.

Proposition 7.1 (Failure of Uniform Continuity) \(f : E \to \mathbb{R}\) is not uniformly continuous if and only if there is an \(\varepsilon_0 > 0\) and sequences \((x_n), (y_n)\) in \(E\) with \[ |x_n - y_n| \to 0 \qquad\text{but}\qquad |f(x_n) - f(y_n)| \ge \varepsilon_0 \ \text{ for all } n. \]

Negating the definition, there is an \(\varepsilon_0\) such that for every \(\delta > 0\) there are \(x, y \in E\) with \(|x - y| < \delta\) and \(|f(x) - f(y)| \ge \varepsilon_0\). Taking \(\delta = 1/n\) produces the sequences. Conversely, given such sequences, no \(\delta\) can work for \(\varepsilon_0\), since \(|x_n - y_n| < \delta\) for large \(n\). \(\square\)

Example 7. \(x^2\) is not uniformly continuous on \(\mathbb{R}\). Take \(x_n = n\) and \(y_n = n + \tfrac1n\). Then \(|x_n - y_n| = \tfrac1n \to 0\), but \[ |f(y_n) - f(x_n)| = \left(n + \tfrac1n\right)^2 - n^2 = 2 + \tfrac{1}{n^2} \ge 2. \] The steepness grows without bound, so a fixed horizontal window gives an ever larger vertical change.

Example 8. \(1/x\) is not uniformly continuous on \((0,1]\). Take \(x_n = \tfrac1n\) and \(y_n = \tfrac1{2n}\). Then \(|x_n - y_n| = \tfrac1{2n} \to 0\), but \(|f(x_n) - f(y_n)| = |n - 2n| = n \ge 1\). Here the trouble is not unbounded domain but the missing endpoint \(0\).

In both examples the failure comes from the same two things that ruined the Extreme Value Theorem: an unbounded domain, or a missing endpoint. On a closed bounded interval, neither can happen.

Theorem 7.6 (Heine–Cantor) A continuous function on a closed bounded interval \([a,b]\) is uniformly continuous.

The proof turns a failure of uniformity into a sequence, then lets Lemma 7.1 trap the sequence at a point where ordinary continuity gives a contradiction.

Suppose \(f\) is continuous on \([a,b]\) but not uniformly continuous. By Proposition 7.1 there are \(\varepsilon_0 > 0\) and sequences \(x_n, y_n \in [a,b]\) with \(|x_n - y_n| \to 0\) and \(|f(x_n) - f(y_n)| \ge \varepsilon_0\). By Lemma 7.1 a subsequence \(x_{n_k} \to c \in [a,b]\). Then \(|y_{n_k} - c| \le |y_{n_k} - x_{n_k}| + |x_{n_k} - c| \to 0\), so \(y_{n_k} \to c\) as well. By continuity at \(c\) (Theorem 7.1), \(f(x_{n_k}) \to f(c)\) and \(f(y_{n_k}) \to f(c)\), hence \(|f(x_{n_k}) - f(y_{n_k})| \to 0\), contradicting \(\ge \varepsilon_0\). \(\square\)

This theorem is why the chapter on integration will be possible: it lets one step size serve a whole interval.

7.8 Lipschitz Continuity

Uniform continuity says that a \(\delta\) exists for each \(\varepsilon\) but not how \(\delta\) depends on \(\varepsilon\). The cleanest possible dependence is a fixed multiple.

Definition 7.4 (Lipschitz Continuity) A function \(f : E \to \mathbb{R}\) is Lipschitz on \(E\) if there is a constant \(K \ge 0\) with \[ |f(x) - f(y)| \le K\,|x - y| \qquad\text{for all } x, y \in E. \] The smallest such \(K\) is the Lipschitz constant of \(f\).

For \(x \ne y\) the condition says \(\left|\dfrac{f(x) - f(y)}{x - y}\right| \le K\): every secant line of the graph has slope between \(-K\) and \(K\). Geometrically, if you place a double cone of slope \(K\) at any point of the graph, the whole graph stays inside it.

Proposition 7.2 (Lipschitz Implies Uniformly Continuous) If \(f\) is Lipschitz on \(E\) with constant \(K\), then \(f\) is uniformly continuous on \(E\).

Enlarging \(K\) if necessary, assume \(K > 0\). Given \(\varepsilon > 0\) put \(\delta = \varepsilon / K\). If \(|x - y| < \delta\) then \(|f(x) - f(y)| \le K|x - y| < \varepsilon\). \(\square\)

So Lipschitz is the strongest of the three notions, and in the Lipschitz case we can read off \(\delta = \varepsilon/K\) at a glance. That is the same exchange rate we saw for linear functions: \(f(x) = mx + b\) is Lipschitz with \(K = |m|\).

Example 9. The function \(|x|\) is Lipschitz with \(K = 1\), since \(\big||x| - |y|\big| \le |x - y|\) (the reverse triangle inequality).

Example 10. \(\sin\) and \(\cos\) are Lipschitz with \(K = 1\) on all of \(\mathbb{R}\). For sine, \[ |\sin x - \sin y| = 2\left|\cos\tfrac{x+y}{2}\right|\left|\sin\tfrac{x-y}{2}\right| \le 2\cdot 1\cdot\tfrac{|x - y|}{2} = |x - y|, \] using \(|\sin t| \le |t|\) for all \(t\) (for \(0 < |t| < \pi/2\) this is Theorem 5.1, and for \(|t| \ge \pi/2\) it holds because \(|\sin t| \le 1 < |t|\)). The cosine is the same with \(\cos x - \cos y = -2\sin\frac{x+y}{2}\sin\frac{x-y}{2}\). This also proves that sine and cosine are continuous, as promised.

Example 11. \(x^2\) is Lipschitz on \([-R, R]\) with \(K = 2R\), because \(|x^2 - y^2| = |x - y|\,|x + y| \le 2R\,|x - y|\). The constant depends on the size of the interval, and on all of \(\mathbb{R}\) no constant works. This agrees with Example 7.

Lipschitz is strictly stronger than uniform continuity, and the standard counterexample is the square root.

Example 12. \(\sqrt{x}\) is uniformly continuous on \([0,\infty)\) but not Lipschitz on \([0,1]\).

Uniformly continuous. For \(x \ge y \ge 0\) we claim \(\sqrt x - \sqrt y \le \sqrt{x - y}\). Squaring \(\sqrt y + \sqrt{x-y}\) gives \(y + (x - y) + 2\sqrt{y(x-y)} \ge x\), which is the claim. So \(|\sqrt x - \sqrt y| \le \sqrt{|x - y|}\), and \(\delta = \varepsilon^2\) works.

Not Lipschitz. Compare with the point \(0\): \(\dfrac{\sqrt x - \sqrt 0}{x - 0} = \dfrac{1}{\sqrt x}\), which is unbounded as \(x \to 0^+\). The graph becomes vertical at the origin, and no cone fits.

Lipschitz vs Non-Lipschitz

The three notions sit in a chain, and none of the arrows reverses: \[ \text{Lipschitz} \ \Longrightarrow\ \text{uniformly continuous} \ \Longrightarrow\ \text{continuous}. \]

Class Example that is in it but not in the next stronger one
continuous, not uniformly \(x^2\) on \(\mathbb{R}\), \(\frac1x\) on \((0,1]\)
uniformly continuous, not Lipschitz \(\sqrt x\) on \([0,1]\)
Lipschitz \(\sin x\), \(\lvert x\rvert\), \(mx + b\), \(x^2\) on \([-R,R]\)

Lipschitz constants also behave well under combination: they add for sums and multiply for compositions (Problem 7). And Lipschitz is the right notion for what comes next. When we define derivatives, we will see that a function with \(|f'| \le K\) is Lipschitz with constant \(K\). In the other direction, in Chapter 1 the affine recurrence \(a_{n+1} = c\,a_n + d\) is given by the function \(x \mapsto cx + d\), which is Lipschitz with constant \(|c|\), and the behavior we found there (distance to equilibrium multiplied by \(c\) at each step) is a special case of a general fact: if \(K < 1\), iterating a Lipschitz map converges to a unique fixed point.

TipKey Ideas
  • Continuity at \(a\) means \(\lim_{x \to a} f(x) = f(a)\): the function is defined at \(a\), has a limit there, and the two agree. Failures come in four types (removable, jump, infinite, oscillating), and only the first can be repaired.
  • Continuity can be tested with sequences: \(x_n \to a\) must imply \(f(x_n) \to f(a)\). To refute continuity, exhibit one sequence that fails.
  • Continuity passes through sums, products, quotients and compositions, so most functions are verified by decomposition rather than by \(\varepsilon\) and \(\delta\).
  • The Intermediate Value Theorem says a continuous function on an interval cannot skip values. Its proof uses the least upper bound property, and it fails over \(\mathbb{Q}\).
  • The Extreme Value Theorem says a continuous function on a closed bounded interval attains a maximum and a minimum. Every hypothesis is needed.
  • Uniform continuity swaps the quantifiers: one \(\delta\) for the whole set. It can fail on unbounded domains and near missing endpoints, and it never fails on \([a,b]\).
  • Lipschitz continuity bounds all secant slopes by \(K\). It implies uniform continuity with \(\delta = \varepsilon/K\), and it is the setting in which derivatives will give a global bound.

True or false: The Extreme Value Theorem guarantees that \(f(x) = 1/x\) attains a maximum on \((0, 1]\).

True or false: Every function that is uniformly continuous on \([0,1]\) is Lipschitz on \([0,1]\).

  1. Classify the discontinuity (removable, jump, infinite or oscillating) of each function at the given point, or say that the function is continuous there. If it is removable, say how to repair it.

    1. \(f(x) = \dfrac{x^2 - 9}{x - 3}\) at \(x = 3\) (a hole, since \(f(3)\) is undefined).

    2. \(f(x) = \lfloor x \rfloor\) at \(x = 1\) and at \(x = 1.5\).

    3. \(f(x) = \cos(1/x)\) at \(x = 0\), with \(f(0) = 0\).

    4. \(f(x) = \dfrac{1}{(x-1)^2}\) at \(x = 1\), with \(f(1) = 0\).

  2. Let \[ h(x) = \begin{cases} x^2 - 1 & x < 1, \\ ax + b & x \ge 1. \end{cases} \]

    1. What equation must \(a\) and \(b\) satisfy for \(h\) to be continuous at \(1\)?

    2. Find \(a\) and \(b\) if in addition \(h(2) = 5\).

    3. With these values, use Theorem 7.3 to show that \(h(x) = 2\) has a solution in \([0, 2]\).

  3. Existence results.

    1. Show that \(p(x) = x^5 - 3x + 1\) has at least three real roots. (Evaluate \(p\) at \(-2, -1, 0, 1, 2\).)

    2. Show that \(\cos x = x\) has a solution in \([0,1]\) using Theorem 7.4.

    3. Use two bisection steps to locate that solution in an interval of length \(0.25\).

  4. Let \(f(x) = x\) for \(x \in \mathbb{Q}\) and \(f(x) = 0\) for \(x \notin \mathbb{Q}\). Show that \(f\) is continuous at \(0\) and discontinuous at every other point.

  5. Let \(f : [a,b] \to \mathbb{R}\) be continuous with \(f(x) \ne 0\) for all \(x\).

    1. Show that there is an \(m > 0\) with \(|f(x)| \ge m\) for all \(x \in [a,b]\). (Apply Theorem 7.5 to \(|f|\).)

    2. Conclude that \(1/f\) is bounded on \([a,b]\).

    3. Show that both conclusions can fail on \((0, 1]\) for a suitable \(f\). Which hypothesis of Theorem 7.5 did you lose?

  6. Uniform continuity.

    1. Show that \(f(x) = 1/x\) is Lipschitz on \([c, \infty)\) for every \(c > 0\), and find its Lipschitz constant bound.

    2. Show that \(f(x) = 1/x\) is not uniformly continuous on \((0, 1]\).

    3. Show that \(f(x) = x^3\) is not uniformly continuous on \(\mathbb{R}\).

  7. Lipschitz constants.

    1. If \(f, g\) are Lipschitz on \(E\) with constants \(K_f, K_g\), show that \(f + g\) is Lipschitz. If \(g(E) \subseteq F\) and \(f\) is Lipschitz on \(F\), show that \(f \circ g\) is Lipschitz, and find constants.

    2. Show that \(|\cos x - \cos y| \le |x - y|\).

    3. Show that \(\sqrt x\) is Lipschitz on \([1, \infty)\) with constant \(\tfrac12\). (Hint: rationalize \(\sqrt x - \sqrt y\).)

    4. Show that \(\sqrt x\) is not Lipschitz on \([0,1]\), yet is uniformly continuous there. Which theorem explains the second fact without computation?

    1. Removable. For \(x \ne 3\), \(f(x) = x + 3 \to 6\). Setting \(f(3) = 6\) repairs it.

    2. At \(x = 1\) it is a jump: the left limit is \(0\), the right limit is \(1\), and \(f(1) = 1\). At \(x = 1.5\) the function equals \(1\) on a neighborhood, so it is continuous there.

    3. Oscillating. With \(x_n = \frac{1}{2n\pi}\) and \(y_n = \frac{1}{(2n+1)\pi}\), both tending to \(0\), \(\cos(1/x_n) = 1\) and \(\cos(1/y_n) = -1\), so no limit exists.

    4. Infinite. \(\frac{1}{(x-1)^2} \to \infty\) as \(x \to 1\), so no value of \(f(1)\) can repair it.

    1. \(\lim_{x \to 1^-} h(x) = 0\) and \(h(1) = a + b\), so \(a + b = 0\).

    2. \(h(2) = 2a + b = 5\) and \(b = -a\) give \(a = 5\), \(b = -5\).

    3. \(h\) is continuous: it is a polynomial on each side of \(1\) and the one-sided limits at \(1\) agree with \(h(1) = 0\). We have \(h(0) = -1 < 2 < 5 = h(2)\), so Theorem 7.3 gives a \(c \in (0,2)\) with \(h(c) = 2\).

    1. \(p(-2) = -25\), \(p(-1) = 3\), \(p(0) = 1\), \(p(1) = -1\), \(p(2) = 27\). The sign changes occur on \((-2,-1)\), \((0,1)\) and \((1,2)\), three disjoint intervals, so there are at least three roots by Theorem 7.3.

    2. Cosine is continuous and decreasing on \([0,1]\), with values in \([\cos 1, 1] \subset [0,1]\) because \(\cos 1 > 0\) (since \(1 < \pi/2\)). By Theorem 7.4 there is a \(c \in [0,1]\) with \(\cos c = c\).

    3. Let \(g(x) = \cos x - x\). Then \(g(0.5) \approx 0.378 > 0\) and \(g(0.75) \approx -0.018 < 0\), so the solution lies in \([0.5, 0.75]\).

  1. At \(0\): \(|f(x) - f(0)| = |f(x)| \le |x|\), so \(\delta = \varepsilon\) works. At \(a \ne 0\): choose rationals \(q_n \to a\) and irrationals \(r_n \to a\). Then \(f(q_n) = q_n \to a \ne 0\) while \(f(r_n) = 0 \to 0\). Continuity at \(a\) would force both limits to equal \(f(a)\) (Theorem 7.1), which is impossible.

    1. \(|f|\) is continuous (a composition of \(f\) with \(|\cdot|\), which is Lipschitz). By Theorem 7.5 it attains a minimum \(m = |f(c)|\) for some \(c \in [a,b]\). Since \(f(c) \ne 0\), \(m > 0\), and \(|f(x)| \ge m\) everywhere.

    2. \(|1/f(x)| \le 1/m\) for all \(x \in [a,b]\).

    3. Take \(f(x) = x\) on \((0,1]\). It is continuous and never zero, but \(\inf|f| = 0\) and \(1/f\) is unbounded. The interval is not closed, so the endpoint \(0\) is missing, which is the hypothesis of closedness.

    1. For \(x, y \ge c\), \(\left|\frac1x - \frac1y\right| = \frac{|x - y|}{xy} \le \frac{|x-y|}{c^2}\), so \(K = 1/c^2\) works.

    2. Take \(x_n = \frac1n\) and \(y_n = \frac1{n+1}\). Then \(|x_n - y_n| = \frac{1}{n(n+1)} \to 0\), but \(|f(x_n) - f(y_n)| = |n - (n+1)| = 1\). Apply Proposition 7.1.

    3. Take \(x_n = n\) and \(y_n = n + \frac{1}{n^2}\). Then \(|x_n - y_n| \to 0\), while \[ y_n^3 - x_n^3 = 3n^2\cdot\tfrac{1}{n^2} + 3n\cdot\tfrac{1}{n^4} + \tfrac{1}{n^6} \ge 3. \]

    1. \(|f(x) + g(x) - f(y) - g(y)| \le (K_f + K_g)|x - y|\). For the composition, \(|f(g(x)) - f(g(y))| \le K_f|g(x) - g(y)| \le K_f K_g |x - y|\).

    2. \(\cos x - \cos y = -2\sin\frac{x+y}{2}\sin\frac{x-y}{2}\), and \(|\sin t| \le |t|\), so the absolute value is at most \(2\cdot\frac{|x-y|}{2} = |x - y|\).

    3. For \(x, y \ge 1\), \(|\sqrt x - \sqrt y| = \dfrac{|x - y|}{\sqrt x + \sqrt y} \le \dfrac{|x-y|}{2}\), since \(\sqrt x + \sqrt y \ge 2\).

    4. \(\dfrac{\sqrt x - \sqrt 0}{x - 0} = \dfrac{1}{\sqrt x}\) is unbounded as \(x \to 0^+\), so no constant \(K\) works. Uniform continuity: by Example 12, \(\delta = \varepsilon^2\) works. Theorem 7.6 gives it with no computation, since \(\sqrt x\) is continuous on the closed bounded interval \([0,1]\).