Chapter 5. Continuity
Continuity turns small changes in an input into small changes in its output. We begin with this local condition, then use subsequences and completeness to prove that continuous functions attain extrema and intermediate values. On a closed bounded interval, uniform continuity also lets us approximate the whole graph by straight segments.
5.1 Continuity
Limits and continuity at a point
Let be an interval containing at least two points, and let .
Definition 5.1.1 (Limit of a function). Suppose that can be approached by points of . We write
if, for every , there is a such that
The condition excludes the point itself. The limit describes the values near , so it does not depend on the value , or even require that be defined.
The left-hand limit and right-hand limit are written
Their definitions restrict the input condition to and , respectively. When is an interior point of , the two-sided limit exists exactly when both one-sided limits exist and have the same value.
Definition 5.1.2 (Continuity). 33 The function is continuous at if
Equivalently, for every , there is a such that
It is continuous on if it is continuous at every point of .
For , left continuity and right continuity mean, respectively,
Each condition is considered when can be approached from that side through the domain. At an endpoint of , only inputs belonging to are considered. Thus continuity on means ordinary continuity in , right continuity at , and left continuity at . Figure 5.1 shows how an input neighbourhood is chosen to fit a prescribed output neighbourhood.
Algebra of limits
Proposition 5.1.3 (Limit laws). Suppose that
where . For every ,
Also,
Proof. Fix . For the sum, choose input neighbourhoods in which and . Taking the smaller of their two radii ensures both estimates whenever and is smaller than that radius. Then
If , the scalar-multiple rule is immediate. If , choose a neighbourhood in which . Then . The difference rule follows by applying the sum rule to and .
For the product, first restrict the neighbourhood so that , which gives . Shrink it further so that both
hold. Such a common neighbourhood exists by the two assumed limits. Within it,
Finally, suppose . Choose a neighbourhood in which . The reverse triangle inequality gives there, and hence
Shrinking the neighbourhood to also require makes this error smaller than . Thus . Apply the product rule to and to obtain . ◻
The last condition ensures that is nonzero sufficiently near . These laws show that sums, scalar multiples, and products of continuous functions are continuous. A quotient is continuous wherever its denominator is nonzero. In particular, constant functions and are continuous, so every polynomial is continuous.
Exercise 5.1.4
Use the definition of a function being continuous at a point, show that if is continuous at , so is the function
Testing continuity with sequences
The following characterization connects the definition above with the sequence methods already developed. The sequences approach through the domain of the function, including from only one side at an endpoint.
Theorem 5.1.5 (Sequential characterization of continuity). Let and . Then is continuous at if and only if every sequence in satisfies
Proof. Suppose first that is continuous at and that . Given , continuity provides a such that whenever and . Since , this input condition holds for all sufficiently large . Hence .
Conversely, suppose that is not continuous at . There is then an such that, for every , we can choose with
Thus , while does not tend to . This contradicts the stated sequence property and proves the converse. ◻
Exercise 5.1.6
Let be continuous over satisfying the additivity condition
Show that there is a constant such that . (Hint: First prove this when is an integer and identify what is. Then prove this when is rational. Finally pass to limit for any real by using the denseness of in .)
Examples of discontinuity
Definition 5.1.7 (Indicator function). For a set , its indicator function is
Example 5.1.8 (A jump at one point). Fix and define
Its one-sided limits at are different, since
Consequently is discontinuous at , although it is constant near every other point and hence continuous there.
Example 5.1.9 (The Dirichlet function). 34 The Dirichlet function is
This function is nowhere continuous.
Every neighbourhood of a real number contains both rational and irrational numbers. Thus, however small the neighbourhood, the function takes both values and . Taking in the definition rules out continuity at every point.
Example 5.1.10 (Thomae’s function). 35

Thomae’s function, also called the popcorn function, is
In the rational case, the fraction is written in lowest terms, with , , and . In particular, .
The function is discontinuous at every rational point. Indeed, if is rational in lowest terms, then . Choose irrational numbers . Since for every , the sequential characterization rules out continuity at .
The function is continuous at every irrational point . For a sequence of rational numbers , the denominators tend to infinity, giving
To justify the assertion about denominators, fix . The convergent sequence eventually lies in . Only finitely many reduced fractions in this interval have denominator at most , since their numerators are also bounded. None equals the irrational number , so a sufficiently small neighbourhood of avoids all of them. Eventually , proving that .
Now take any sequence . Its irrational terms have , while the argument above makes the values at its rational terms arbitrarily small as well. Hence , and Theorem 5.1.5 proves continuity at . Figure 5.3 illustrates why only finitely many large values need to be avoided near .
Composition
Theorem 5.1.11 (Composition of continuous functions). Let and , where . If is continuous at and is continuous at , then is continuous at , where
Proof. If with , continuity of gives . These values lie in , so continuity of gives . Apply Theorem 5.1.5 to . ◻
Exercise 5.1.12
Use the definition of a function being continuous at a point, prove that if is continuous at , is continuous at , then is continuous at as well.
5.2 Maximum (extreme value theorem)
Theorem 5.2.1 (Extreme value theorem). Let be real numbers and let be continuous. Then is bounded, and both its supremum and its infimum are attained. Thus there are such that
Boundedness gives a finite supremum. Attainment says more. There must actually be a point of the domain at which the function has this value. Figure 5.4 illustrates the distinction used in the proof.
Proof. Suppose first that is unbounded above. For each , choose such that . By Theorem 3.3.1, the bounded sequence has a convergent subsequence with . Continuity and Theorem 5.1.5 give
But , which is a contradiction. Hence is bounded above.
The function is also continuous. The same argument shows that is bounded above, so is bounded below as well.
Put . This is a finite real number. Since is not an upper bound, for each there is such that
Again take a convergent subsequence . Continuity gives
On the other hand, by the definition of the supremum. Therefore .
Apply the maximum argument to . There is such that for every . Thus is the minimum of . ◻
Exercise 5.2.2
Let be continuous over and satisfy the “coercive” condition:
where and are two constants.
-
(a) Show that exists.
-
(b) Show that attains somewhere at . That is, there is some such that
Such a point is called a global minimum point of over .
(Hint: Let be a sequence such that
Show that contains a convergent subsequence.)
Intermediate value theorem
Theorem 5.3.1 (Intermediate value theorem). Let be real numbers and let be continuous. Write
For every , there is such that . In other words, the image of is the interval
The extreme value theorem supplies the endpoints of the image. The intermediate value theorem says there are no gaps between them. Figure 5.5 shows the central idea. Subtracting the desired value turns the problem into finding a zero.
Proof. If , the function is constant and the conclusion follows. The endpoint values and are already attained by Theorem 5.2.1. Suppose that . Choose with and , and first suppose that . The continuous function satisfies
Let
The set contains and is bounded above by , so exists and lies in . Continuity and the strict endpoint signs give .
If , continuity gives points just to the right of at which remains negative. Such a point belongs to , contradicting that is an upper bound. If , continuity gives such that whenever . The definition of the supremum gives an element of greater than , again a contradiction. Hence , so .
If , apply the same argument to on . Its left endpoint value is negative and its right endpoint value is positive, and a zero of is also a zero of . ◻
Roots as an application
Example 5.3.2 (Reaching every nonnegative value with a power). Let and consider for . This function is continuous and strictly increasing, with and as . For any , choose with . On , the function takes every value in . Thus there is with , and . Every nonnegative real number therefore has an th root. Strict increase gives uniqueness. This is an alternative existence argument to Theorem 1.11.1, whose earlier proof used completeness directly. The present argument uses continuity of , without presupposing continuity of its inverse.
Exercise 5.3.3
Let be a continuous function which maps the interval into itself. Prove that has a fixed point in . That is, there is some such that . Use your result to prove that for any there is some such that
Find for .
Exercise 5.3.4
Show that if the highest degree term of a polynomial is odd powered, then it must have a real root.
Continuity of an inverse
Definition 5.3.5 (Monotone functions). A function is nondecreasing if implies , and nonincreasing if implies . It is monotone if it has either property. Replacing these weak inequalities by strict inequalities defines strictly increasing and strictly decreasing functions. These two cases are called strictly monotone.
Theorem 5.3.6 (Continuity of an increasing inverse). Let be real numbers and let be continuous and strictly increasing. Put and . Then the inverse function
is continuous.
Strict increase makes injective, and Theorem 5.3.1 shows that its image is exactly . Together these facts justify the existence of . The graphs of and interchange their coordinates, as Figure 5.6 illustrates.
Proof. Suppose that is not continuous at , and put . By the failure of continuity, there are and points such that
Set . Since , Theorem 3.3.1 gives a subsequence . Continuity of yields
But , so uniqueness of limits gives . Injectivity of then gives . This contradicts for every , since . Therefore is continuous at . ◻
The inverse of a continuous strictly decreasing function is continuous as well. Apply the theorem to , which is strictly increasing, and compose its continuous inverse with . Strict monotonicity is essential for an inverse to exist. A merely monotone function can take the same value at several inputs.
Example 5.3.7 (Continuity of roots and rational powers). For , the root function is continuous for . Indeed, for every the power map is a continuous, strictly increasing bijection from onto . Its inverse is continuous by Theorem 5.3.6. These intervals cover all nonnegative inputs, including relative continuity at zero.
For and , the rational power is also continuous on . For positive , it is continuous at zero as well. This follows by composing the root function with the integer power function, and taking a reciprocal when .
5.4 Uniform continuity
For continuity at a single point , the choice of may depend on as well as . Uniform continuity asks for one that works throughout the domain.
Definition 5.4.1 (Uniform continuity). A function is uniformly continuous on if for every there is a such that
The same must work throughout .
Figure 5.7 compares the square function on two domains, keeping the output tolerance fixed at .
For on ,
so the single choice works for every pair of inputs. The shaded windows use and .
On , take and . Then
Keep fixed. Whatever is chosen, taking gives inputs closer than whose outputs are more than apart. This is the failure of uniform continuity. Continuity at each point allows the input tolerance to shrink as the point moves.
Theorem 5.4.2 (Heine–Cantor). Every continuous function on a closed bounded interval is uniformly continuous there.
Proof. Suppose otherwise. Then there is some such that for every we can choose with
By Theorem 3.3.1, has a convergent subsequence . Apply the theorem again to the bounded sequence to obtain a convergent subsequence . With these same indices, still converges. Write
Both limits belong to , since every selected term lies between and . Moreover,
so . By continuity and Theorem 5.1.5,
This contradicts the lower bound on every one of these differences. ◻

The indices in the proof matter. We first select a convergent subsequence of the , then refine its indices to make the corresponding converge too. We never separate the pairs. Their shrinking distance then forces the same limit, as Figure 5.8 illustrates.
Exercises on uniform continuity
Exercise 5.4.3
Let be a continuous function over an interval , with finite endpoints , which may or may not be closed. Prove that if is uniformly continuous over , then is bounded. With this result, show that the function
is continuous but not uniformly continuous.
Exercise 5.4.4
Show that the function is not uniformly continuous over and explain what goes “wrong”.

Exercise 5.4.5
Consider a function over . We say that is Lipschitzian if there is a constant such that
Here is called the Lipschitz constant of .
-
(a) Prove that a Lipschitz function is uniformly continuous over the entire .
-
(b) Consider the function
Show that this function is Lipschitzian and estimate its Lipschitzian constant.
Piecewise linear approximation
Partition into
The partition is equally spaced when for .
Definition 5.4.6 (Piecewise linear function). A function is piecewise linear if, on each interval , it agrees with an affine function .
To approximate a continuous function , join its successive values by straight segments. On the slope is
and the segment is given by
The pieces agree at the partition points, since . The curved graph and its straight interpolating segments are shown in Figure 5.11.
Proposition 5.4.7 (Piecewise linear approximation). If is continuous, then for every there is a piecewise linear function such that
Proof. By Theorem 5.4.2, choose so that points less than apart have function values less than apart. Choose an equally spaced partition with , and let be the interpolant above.
If , put . Then and
Both endpoints are less than from , so
The same partition works for every , as required. ◻
The construction also motivates integration. A piecewise linear function can be treated one segment at a time, turning its integral into a finite sum. We return to this idea in Chapter 7.