18 Working with Continuity
18.1 Building Continuous Functions
Because we have an equivalent characterization of continuity in terms of sequence convergence, and we have many theorems about this, we can use our characterization to rephrase these as results about continuity.
Proposition 18.1 (Continuity of Constant Multiples) If \(f\) is continuous at \(a\in\RR\) and \(k\in\RR\) is a constant, then the function \(kf\colon x\mapsto kf(x)\) is continuous at \(a\).
Proof. Let \(a\in\RR\) be arbitrary, and \(x_n\) a sequence converging to \(a\). Then by the limit theorem for multiples, \(kx_n\to ka\). Rephrasing this in terms of the function \(f(x)=kx\), this just says that \(\lim f(x_n)=f(\lim x_n)\) so \(f\) is continuous at \(a\).
Theorem 18.1 (Continuity and the Field Operations) Let \(f,g\) be functions which are continuous at a point \(a\). Then the functions \(f(x)+g(x),f(x)-g(x)\) and \(f(x)g(x)\) are all continuous at \(a\). Furthermore if \(g(a)\neq 0\) then \(f(x)/g(x)\) is also continuous at \(a\).
Proof. Let \(f,g\) be any two continuous functions and let \(a\in\RR\) be a point in their domains. Let \(x_n\) be any sequence converging to \(a\). Since \(f\) is continuous we know that \(\lim f(x_n)=f(\lim x_n)=f(a)\) and similarly by the continuity of \(g\), \(\lim g(x_n)=f(\lim x_n)=g(a)\). Thus by the limit theorem for sums, the sequence \(f(x_n)+g(x_n)\) is convergent, with \[\lim\left(f(x_n)+g(x_n)\right)=\lim f(x_n)+\lim g(x_n)=f(a)+g(a)\] So, \(f+g\) is continuous at \(a\). Since \(a\) was arbitrary, we see that \(f+g\) is continuous at every point of its domain. The same argument applies for subtraction, multiplication, and division using the respective limit theorems for sequences.
Exercise 18.1 Prove the remaining cases
One of the most important operations for functions is that of composition: if \(f\colon \RR\to\RR\) and \(g\colon\RR\to\RR\) then the function \(g\circ f\colon\RR\to\RR\) is defined as \(g\circ f(x):=g\left(f(x)\right)\). More generally, so long as the domain of \(g\) is a subset of the range of \(f\), the composition \(g\circ f\) is well defined.
Theorem 18.2 (Continuity of Compositions) Let \(f, g\) be functions such that \(f\) is continuous at \(a\), and \(g\) is continuous at \(f(a)\). Then the composition \(g\circ f(x):=g(f(x))\) is continuous at \(a\).
Proof. Let \(x_n\) be an arbitrary sequence converging to \(a\in\RR\): we wish to show that \(\lim g(f(x_n))=g(f(\lim x_n))=g(f(a))\). Since \(f\) is continuous at \(x=a\) we see immediately that \(f(x_n)\) is a convergent sequence with \(f(x_n)\to f(a)\). And now, since \(g\) is assumed to be continuous at \(x=f(a)\) and \(f(x_n)\) is a sequence converging to this point, we know \(g(f(x_n))=g(f(a))\) as required.
Exercise 18.2 Let \(f(x)\) be a continuous function, and assume that \(f(x)^2\) is a constant function. Prove that \(f(x)\) is constant.
Give an example of an \(f(x)\) where \(f(x)^2\) is constant, but \(f\) is not.
Theorem 18.3 (Continuity of Roots) The function \(R(x)=\sqrt{x}\) is continuous on \([0,\infty)\).
Proof. Actually we already proved this, before we had the terminology! Re-read ?exr-limit-of-root: it shows that if \(x_n\to a\) is a convergent sequence with \(x_n\geq 0\) and \(a\geq 0\), then \(\sqrt{x_n}\to\sqrt{a}\). So \(\lim \sqrt{x_n}=\sqrt{\lim x_n}\), and \(\sqrt{x}\) is continuous at the arbitrary nonnegative real \(a\).
The same is true for \(n^{th}\) roots, though we do not stop to prove it here, you may wish to for practice! This is a special case of a more general result on the continuity of inverse functions (as the square root is the inverse of \(x^2\))
Theorem 18.4 (Continuity of Inverse Functions) Let \(f\colon A\to B\) be a continuous function for \(A,B\subset\RR\) and \(g\colon B\to A\) be its inverse. If \(f\) is continuous, so is \(g\).
Proof. WRITE PROOF
18.2 Basic Continuous Functions
Example 18.1 (Continuity of \(x^n\))
Exercise 18.3 (Continuity of Polynomials) Prove that every polynomial is a continuous function on the entire real line. Hint: induction on the degree of the polynomial!
Exercise 18.4 (Continuity of Rational Functions) A rational function is a quotient of polynomials \(r(x)=p(x)/q(x)\). Prove that every rational function is continuous, on every point of its domain.
Exercise 18.5 If \(f\) is continuous at a point \(a\), then \(|f|\) is continuous there.
Hint: either use the reverse triangle inequality (?exr-reverse-triangle-inequality) or use that its a composition
Exercise 18.6 (Continuity of Max/Min) Prove that if \(f,g\) are continuous functions then so are \(\max\{f(x),g(x)\}\) and \(\min\{f(x),g(x)\}\).
Hint: use that the max and min can be expressed in terms of absolute values
18.3 Discontinuous Monsters
Example 18.2 The characteristic function of the rational numbers is discontinuous everywhere. \[b(x)=\begin{cases} 1 & x\in\QQ\\ 0 & x\not\in\QQ \end{cases}\]
We saw above a function that is discontinuous at a single point, and then one that is discontinuous everywhere. What’s harder to imagine, is a function that is continuous at a single point. Try thinking about what this might mean!
Exercise 18.7 Show that the following function is continuous at \(0\) and discontinuous everywhere else:
\[g(x)=\begin{cases} x & x\in \QQ\\ 0 & x\not\in\QQ \end{cases}\]
Exercise 18.8 Construct a function that is continuous at non-integer points, but discontinuous at the integers
Functions can have even stranger behavior
Proposition 18.2 The Thomae function \[ \tau(x)=\begin{cases} \frac{1}{q} & x\in\QQ\textrm{ and }\frac{p}{q}\textrm{ is lowest terms.}\\ 0 &x\not\in\QQ \end{cases} \] is continuous at the irrational numbers, and discontinuous at every rational.
18.4 \(\blacklozenge\) Uniform Continuity
Proposition 18.3 (Constant Multiples of Uniformly Continuous Functions) Let \(f\) be uniformly continuous, and \(k\in\RR\). Then \(kf\) is uniformly continuous.
Proof. If \(k=0\) then \(kf\) is the constant zero function, so we ignore that case. For \(k\neq 0\), let \(\epsilon \geq 0\) consider \(\epsilon/|k|\) and take the corresponding uniform \(\delta\) for \(f\). For \(|x-y|<\delta\) we see \(|f(x)-f(y)|<\epsilon/|k|\), and so \[|kf(y)-kf(x)|<|k||f(y)-f(x)|\leq |k|\frac{\epsilon}{|k|}=\epsilon\]
Exercise 18.9 (Sums of Uniformly Continuous Functions) Let \(f\) and \(g\) be uniformly continuous. Then \(f+g\) is uniformly continuous.
From these it follows that \(f-g\) is uniformly continuous (as its equal to \(f+(-1)g\)) and \(af+bg\) are for any \(a,b\in\RR\) are uniformly continuous as well. It might be tempting to believe, after seeing the above proofs that all of the limit laws should have analogs for uniform continuity, just as they did for continuity. But this is not true!
Example 18.3 (Reciprocals need not be Uniformly Continuous) The function \(y=x\) is uniformly continuous and nonzero on \((0,1)\) but its reciprocal \(f(x)=1/x\) is not.
Proof. Fx any \(\delta>0\), and note that given any \(1/n<\delta\) we have \[\frac{1}{n}-\frac{1}{n+1}=\frac{1}{n(n+1)}<\frac{1}{n}<\delta\] but applying \(f\), \[f\left(\frac{1}{n+1}\right)-f\left(\frac{1}{n}\right)=n+1-n=1\] Thus, fixing any \(\epsilon<1\) there can’t be a uniform \(\delta\), as its always possible to find points separated by less than \(\delta\) mapped to points separated by a distance of 1.
This generalizes directly to reciprocals: if \(f\) is uniformly continuous then \(1/f\) need not be
Exercise 18.10 Let \(f\) be uniformly continuous and bounded away from zero: \(f(x)\geq b>0\) for all \(x\) in the domain. Prove that \(1/f\) is uniformly continuous.
What about products? Again we need a boundedness assumption:
Exercise 18.11 (Uniform Continuity and Products) Let \(f\) and \(g\) be uniformly continuous bounded functions with the same domain. Then \(f(x)g(x)\) is uniformly continuous.
Proof. Since \(f,g\) are bounded we chan choose an \(M>0\) with \(|f(x)|<M\) and \(|g(x)|<M\) for all \(x\) in the domain. Let \(\epsilon>0\) be arbitrary, and using uniform continuity for \(f,g\) choose \(\delta_f\) such that \(|x-y|<\delta_f\) implies \(|f(x)-f(y)|<\epsilon/2M\) and an analogous \(\delta_g\) for \(g\). Set \(\delta=\min\{\delta_f,\delta_g\}\) and for any \(x,y\) with \(|x-y|<\delta\) we compute \[|f(y)g(y)-f(x)g(x)|=|f(y)g(y)-f(y)g(x)+f(y)g(x)-f(x)g(x)|\] \[\leq |f(y)g(y)-f(y)g(x)|+|f(y)g(x)-f(x)g(x)|= |f(y)||g(y)-g(x)|+|g(x)||f(y)-f(x)|\] As both \(|f|\) and \(|g|\) are bounded by \(M\), this is less than or equal to \(M(|g(y)-g(x)|+|f(y)-f(x)|)\), and each of these terms is less than \(\epsilon/2M\) by hypothesis, so \[|f(y)g(y)-f(x)g(x)|\leq M\left(\frac{\epsilon}{2M}+\frac{\epsilon}{2M}\right)=\epsilon\] as required.
Exercise 18.12 Show that this boundedness assumption is necessary by giving an example of two uniformly continuous functions whose product is not uniformly continuous.
Proposition 18.4 (Composition of Uniformly Continuous) Let \(f\) and \(g\) be uniformly continuous functions. Then the composition \(f\circ g(x) = f(g(x))\) is uniformly continuous.
Proof. Choose \(\epsilon>0\) and let \(\delta_f\) be a uniform delta for \(f(x)\). Use this to select a uniform \(\delta_g\) for \(g\), such that whenever \(|x-y|<\delta_g\), we have \(|g(x)-g(y)|<\delta_f\). This turns out to be the right uniform value for the composition \(f\circ g\), as \(|g(x)-g(y)|<\delta_f\implies |f(g(x))-f(g(y))|<\epsilon\).
Like reciprocals, inverses pose a problem:
Exercise 18.13 (Inverses and Uniform Continuity) Give an example of a uniformly continuous function whose inverse is not uniformly continuous.