8. Continuity
≪ 7. Rearrangement of Series | Table of ContentsWe’ve built up a lot of theory surrounding limits, sequences, and series, but calculus concerns itself with differentiable and integrable functions. You may remember from aeons ago that you first dipped your toes into continuous functions before describing these two classes of functions, and we’ll be laying the foundations there as well.
The heuristic that’s often repeated is, “A continuous function is one whose graph can be drawn with a single pen stroke.” I humbly request that you wipe this image of a false promise from your mind. The definition of continuity does not impose restrictions on the graph of a function and how practical it is to draw.
Definition 1. (Sequential) Continuity
Let \(D\subseteq \mathbb{R}\), and \(f: D\to \mathbb{R}\). \(f\) is continuous at a point \(x_0\in D\) if, for all sequences \(\left\lbrace x_n \right\rbrace\subseteq D\) converging to \(x_0\), \(f\left( x_n \right)\to f\left( x_0 \right)\). \(f\) is continuous if it’s continuous at each point in \(D\).
In class, you proved that the following definition was equivalent to the above:
Definition 2. (\(\epsilon \)-\(\delta \)) Continuity
Let \(D\subseteq \mathbb{R}\) and \(f: D\to \mathbb{R}\). \(f\) is continuous at a point \(x_0\in D\) if for all \(\epsilon > 0\), there exists \(\delta > 0\) such that \[\left\lvert x-x_0 \right\rvert \implies \left\lvert f(x) - f\left( x_0 \right) \right\rvert < \epsilon .\] \(f\) is continuous if it’s continuous at each point in \(D\).
These are two equivalent but alternative ways of saying: a function is continuous if it takes nearby inputs to nearby outputs. Of course, nearby outputs need not come from nearby inputs. Make sure you get the quantifiers in the right order!
Often, but not always, it’s easier to work with the \(\epsilon \)-\(\delta \) definition of continuity to prove statements about general or abstract functions. Later in this course (or perhaps in 131B), you will see this employed heavily when talking about sequences of continuous functions: dealing with sequences within sequences is very difficult, hence the former definition becomes rather cumbersome. On the other hand, when disproving a single explicit function is continuous (at a point or otherwise), it’s often much easier to work with the latter definition instead.
This may be more obvious if we write the negations of the two definitions:
A function \(f : D\to \mathbb{R}\) is discontinuous at a point \(x_0\in D\) if there exists a sequence \(\left\lbrace x_n \right\rbrace\subseteq D\) converging to \(x_0\) such that \(f\left( x_n \right)\) does not converge to \(f\left( x_0 \right)\).
Alternatively, it is discontinuous at \(x_0\) if there exists \(\epsilon > 0\) such that for all \(\delta > 0\), there exists \(x\in D\) satisfying \(\left\lvert x - x_0 \right\rvert < \delta \) while \(\left\lvert f(x) - f\left( x_0 \right) \right\rvert \geq \epsilon \).
Yeah that latter negation is really annoying to work with, while the former is pretty reasonable.
To illustrate why the “pen stroke heuristic” is not a good heuristic, and to simultaneously demonstrate the benefits of each definition over the other, let’s consider the following example:
Example 3.
Let \(f: \mathbb{R}\to \left[ 0,1 \right]\) be defined as \[f(x) = \begin{cases} \frac{1}{q} & x\in \mathbb{Q} \textrm{ and } x = \frac{p}{q} \textrm{ in reduced form, } \\ 0 & x\notin \mathbb{Q}.\end{cases}\] Show that \(f\) is continuous at \(x_0\) if \(x_0\) is irrational and that \(f\) is discontinuous at \(x_0\) if \(x_0\) is rational.
This is a well-known function of many names; Wikipedia calls it Thomae’s function. Looking at the function’s definition, one might expect it to be discontinuous everywhere. After all, its graph is a collection of points scattered in a loosely triangular shape, with jumps away from zero at every single rational point. With all those discontinuities, there’s no way it can be continuous anywhere.
Continuity at Irrationals
We’ll use the \(\epsilon \)-\(\delta \) definition. One can certainly make the sequential definition work, but it’s going to be a lot.
Let \(x_0\) be irrational and \(\epsilon > 0\). We need to find a \(\delta > 0\) such that for all \(x\in \mathbb{R}\) such that \(\left\lvert x - x_0 \right\rvert < \delta \), then \(\left\lvert f(x) - f \left( x_0 \right) \right\rvert = f(x) < \epsilon .\)
If \(x\) is irrational as well, then \(f(x) = 0 < \epsilon \) is trivial. Thus, we need to concern ourselves with rational points \(x = \frac{p}{q}\) (in reduced form), at which \(f(x) = \frac{1}{q}\). We want \(\frac{1}{q} < \epsilon \).
Let \(Q \in \mathbb{N}\) such that \(\frac{1}{Q} < \epsilon \). The idea is that if \(x\) is a rational number whose denominator (in lowest terms) is bigger than \(Q\), then \(f(x) < \frac{1}{Q} < \epsilon \). There aren’t too many rational numbers where this isn’t the case, so we can choose \(\delta \) wisely to force this to happen.
Specifically, define \(\delta = \min \left\lbrace \left\lvert \frac{p}{q} - x_0 \right\rvert : q \leq Q \right\rbrace.\) This minimum exists because there are only finitely many such \(\frac{p}{q}\) within a unit of \(1\) away from \(x\), and each of those distances is strictly positive (otherwise, \(x_0\) would be rational).
If \(x\in \mathbb{R}\) and \(\left\lvert x - x_0 \right\rvert < \delta \), then either \(x\) is irrational, so \(\left\lvert f(x) - f\left( x_0 \right) \right\rvert = 0 < \epsilon \), or \(x = \frac{p}{q}\) (in lowest terms) is rational, forcing \(q > Q\) by construction, hence \[\left\lvert f(x) - f\left( x_0 \right) \right\rvert = \frac{1}{q} < \frac{1}{Q} < \epsilon.\] By definition, \(f\) is continuous at \(x_0\).
Discontinuity at Rationals
Exercise 4.
Let \(\left\lbrace a_n \right\rbrace\) be an enumeration of the rationals (i.e., a sequence that takes the value of each rational exactly once). Define the function \(f:\mathbb{R}\to \mathbb{R}\) via \[f(x) = \sum _{n\ :\ a_n < x} 2 ^{-n}.\]
- Show that \(f(x)\) converges for any real number \(x\).
- Show that \(f\) is continuous at \(x_0\) if and only if \(x_0\) is irrational.
Although these examples are really annoying, we do understand continuous functions much, much better when we know they’re continuous on a whole interval of real numbers. This is because of two very, very important theorems that you almost surely learned back in calculus.
Theorem 5. The Extreme Value Theorem
Let \(a < b\), and let \(f: \left[ a, b \right]\to \mathbb{R}\) be continuous. Then, there exist points \(m, M\in \left[ a, b \right]\) such that \[f(m) \leq f(x) \leq f(M)\] for all \(x\in \left[ a, b \right]\).
This is saying that continuous functions attain their maximum and minimum values whenever they’re defined on closed intervals. Note that \(m\) and \(M\) need not be unique. Try proving this yourself.
Proof
We’ll only prove that \(M\) exists; the proof for \(m\) should be very similar.
Let \(S = \sup \left\lbrace f(x) : x\in \left[ a, b \right] \right\rbrace\) (with \(S = +\infty\) if the set is unbounded). There is a sequence \(\left\lbrace y_n \right\rbrace \subseteq S\) such that \(\lim y_n = S\). By definition of \(S\), there exist points \(x_n\subseteq \left[ a, b \right]\) such that \(y_n = f\left( x_n \right)\) for all \(n\). Since \(x_n\) is a bounded sequence, by Bolzano-Weierstrass there is a converging subsequence \(x _{n_k} \to x_0\), with \(x_0 \in \left[ a, b \right]\). Then \(\lim _{k\to\infty} y _{n_k} = S\) as before, hence \[f\left( x_0 \right) = \lim _{k\to\infty} f\left( x _{n_k} \right) = \lim _{k\to\infty} y_k = S\] by continuity. Hence \(S\) cannot be infinite, and \(M = x_0\) satisfies the inequality above by construction of \(S\). \(\square\)
Exercise 6. Intermediate Value Theorem
Let \(a < b\), \(f: \left[ a, b \right] \to \mathbb{R}\) continuous, and suppose \(f(a) < 0\) and \(f(b) > 0\). Then, there exists a \(c\in (a, b)\) such that \(f(c) = 0\).
Hint
Exercise 7.
If \(a < b\) and \(f: \left[ a, b \right] \to \mathbb{R}\) is continuous, show that the range of \(f\) is also a closed interval.
Give examples of continuous functions \(f : (a, b)\to \mathbb{R}\) such that the range of \(f\) is an open interval, a closed interval, and a half-open interval (i.e. \([c, d)\)).