Let \((X,d_X)\text{,}\)\((Y,d_Y)\) be metric spaces. Let \(f:X\rightarrow Y\) be a function. We say \(f\) is continuous at a point \(x_0\in X\) if for all \(\varepsilon>0,\exists\delta>0\) such that for all \(x\in X\) with \(d_X(x,x_0)<\delta\) we have \(d_Y(f(x),f(x_0))<\varepsilon\text{.}\)
A function \(f:X\rightarrow Y\) is continuous if \(f\) is continuous at every point \(x_0\in X\text{.}\)
Convention4.84.
We'll often use \(d\) to denote both the metric on \(X\) and the metric on \(Y\) when it causes no confusion.
Fix \(x_0\in \mathbb{R}\) and \(\varepsilon>0\text{.}\) Let \(\delta=\min\{{\frac{1}{2},\frac{\varepsilon}{2\left|{x_0}\right|+1}}\}>0\text{.}\) If \(x\in\mathbb{R}\) and \(d(x,x_0)<\delta\) then
For \(\varepsilon>0\) and \(x_0\in\mathbb{C}^n\setminus\{{0}\}\text{.}\) Let \(\delta=\min\{{\frac{\left|{\left|{{x_0}}\right|}\right|}{2},\frac{\left|{\left|{{x_0}}\right|}\right|^2\varepsilon}{2}}\}>0\text{.}\)
Fix \(x\in \mathbb{C}^n\setminus\{{0}\}\) with \(\left|{\left|{{x-x_0}}\right|}\right|<\delta\text{.}\) Since \(\left|{\left|{{x-x_0}}\right|}\right|\leq\frac{\left|{\left|{{x_0}}\right|}\right|}{2}\text{,}\) we have \(\left|{\left|{{x}}\right|}\right|\geq \frac{\left|{\left|{{x_0}}\right|}\right|}{2}\text{.}\) Now, \(\left|{f(x)-f(x_0)}\right|=\left|{\frac{1}{\left|{\left|{{x}}\right|}\right|}-\frac{1}{\left|{\left|{{x_0}}\right|}\right|}}\right|\text{.}\) Continue (from above):
If \(n\in\mathbb{Z}_+\setminus\{{0}\}\) and \(f:[0,\infty)\rightarrow\mathbb{R},f(x)=x^{\frac{1}{n}}\text{,}\) then \(f\) is continuous.
Proposition4.90.The Popcorn Function.
There is a function \(f:\mathbb{R}\rightarrow\mathbb{R}\) such that \(f\) is continuous at every irrational number and discontinuous at every rational number.
Fix \(x_0\in\mathbb{Q}\text{.}\) We need \(\exists\varepsilon,\forall\delta>0\,\exists x\in(x_0-\delta,x_0+\delta)\) such that \((x,x_0)<\delta\) and \(d(f(x),f(x_0))\geq \varepsilon\text{.}\) Write \(x_0=\frac{p}{q}\) with \(p,q\in\mathbb{Z},q\geq 1,\gcd(p,q)=1\) so that \(f(x_0)=\frac{1}{q}\text{.}\) Set \(\varepsilon=\frac{1}{q}\text{.}\) Fix \(\delta>0\text{.}\) Let \(x\in (x_0-\delta,x_0+\delta)\) be irrational (know exists from next lemma). Then \(\left|{f(x_0)-f(x)}\right|=\frac{1}{q}=\varepsilon\text{.}\)
Fix \(\varepsilon>0\) and \(x_0\in\mathbb{R}\setminus\mathbb{Q}\text{.}\) Let \(M,N\in\mathbb{Z}_+\setminus\{{0}\}\) with \(\left|{x_0}\right|<M,\frac{1}{N}<\varepsilon\text{.}\) Define \(A=\{{\frac{p}{q}\in \mathbb{Q}}\,:\,{p,q\in\mathbb{Z},1\leq q\leq N,\left|{\frac{p}{q}}\right|\leq M,\gcd(p,q)=1}\}\text{.}\)
Then \(A\) is a finite set and hence is closed. Also as \(A\subseteq \mathbb{Q}\) and \(x_0\notin\mathbb{Q}\text{,}\) we have \(x_0\in(\mathbb{R}\setminus A)\cap(-M,M)\text{.}\) Since \((\mathbb{R}\setminus A)\cap(-M,M)\) is open, exists \(\delta>0\) such that \((x_0-\delta,x_0+\delta)\subseteq (\mathbb{R}\setminus A)\cap(-M,M)\text{.}\)
Fix \(x\in\mathbb{R}\) with \(\left|{x-x_0}\right|<\delta\text{.}\) We want \(\left|{f(x)-f(x_0)}\right|<\varepsilon\text{.}\)
Case 1: If \(x\in\mathbb{R}\setminus\mathbb{Q}\) then \(f(x)=f(x_0)=0\text{.}\)
Case 2: Suppose \(x=\frac{p}{q};p,q\in \mathbb{Z},q\geq 1,\gcd(p,q)=1\text{.}\) As \(\left|{x-x_0}\right|<\delta,\) we have \(\left|{x}\right|<M\) and \(x\notin A\) so \(q>N\) and \(\left|{f(x)}\right|=\frac{1}{q}<\frac{1}{N}<\varepsilon\text{.}\)
Theorem4.91.Characterizations of Continuity.
Let \(X\) and \(Y\) be metric spaces and let \(f:X\rightarrow Y\) be a function. TFAE:
\(f\) is continuous.
For cluster points \(x_0\in X, \lim_{x\rightarrow x_0}f(x)=f(x_0)\text{.}\)
If \((x_n)_{n=1}^\infty\subseteq X\) is a convergent sequence, then \(\lim_{n\rightarrow\infty}f(x_n)=f(\lim_{n\rightarrow\infty}x_n)\text{.}\)
If \(U\subseteq Y\) is an open set, then \(f^{-1}(U)\subseteq X\) is open (where \(f^{-1}(U)=\{{x\in X}\,:\,{f(x)\in U}\}\)).
If \(F\subseteq Y\) is a closed set, then \(f^{-1}(F)\subseteq X\) is closed.
For all sets \(A\subseteq X\text{,}\)\(f(\overline{A})\subseteq \overline{f(A)}\text{.}\)
(1\(\implies\)6) Suppose \(f:X\rightarrow Y\) is continuous and \(A\subseteq X\text{.}\) We want \(f(\overline{A})\subseteq \overline{f(A)}\text{.}\) Fix \(a\in\overline{A}\text{.}\) Fix \(\varepsilon>0\text{.}\) We want \(B_\varepsilon(f(a))\cap f(A)\neq \emptyset\text{.}\) Since \(f\) is continuous, exists \(\delta>0\) so that for all \(x\in X, d(a,x)<\delta\implies d(f(a),f(x))<\varepsilon\text{.}\) Since \(a\in\overline{A}, B_\delta(a)\cap A\neq \emptyset\text{.}\) Let \(x\in B_\delta(a)\cap A\text{.}\) Then \(d(a,x)<\delta\implies d(f(a),f(x))<\varepsilon\text{.}\) Now \(f(x)\in B_\varepsilon(f(a))\cap f(A)\text{.}\)
Suppose \(F\subseteq Y\) is closed. Then \(\star f(\overline{f^{-1}(F)})\subseteq_{(6)}\overline{f(f^{-1}(F))} \subseteq_{(b)} \overline{F}=F\text{.}\) Then \(\overline{f^{-1}(F)}\subseteq_{(a)}f^{-1}(f(\overline{f^{-1}(F)}))\subseteq_\star f^{-1}(F)\subseteq \overline{f^{-1}(F)}\text{.}\) So \(\overline{f^{-1}(F)}=f^{-1}(F)\) so \(f^{-1}(F)\) is closed.
(5\(\implies\)4) Assume 5 holds. Assume \(U\subseteq Y\) is open. Have \(Y\setminus U\) is closed, and so by 5 \(X\setminus f^{-1}(U)=f^{-1}(Y\setminus U)\subseteq X\) is closed. So \(f^{-1}(U)=f^{-1}\) is open.
(4\(\implies\)3) Suppose \((x_n)_{n=1}^\infty\subseteq X\) converges and let \(x=\lim_{n\rightarrow\infty}x_n\text{.}\) Fix \(\varepsilon>0\text{.}\) Then \(B_\varepsilon(f(x))\subseteq Y\) is open. By 4, \(f^{-1}(B_\varepsilon(f(x)))\subseteq X\) is open. Also \(x\in f^{-1}(B_\varepsilon(f(x)))\text{,}\) and hence exists \(\delta>0\) with \(B_\delta(x)\subseteq f^{-1}(B_\varepsilon(f(x)))\text{.}\) Since \(x_n\rightarrow x,\exists N\in\mathbb{Z}_+\) such that for all \(n\geq N, d(x_n,x)<\delta\text{.}\) If \(n\geq N,\) then \(x_n\in B_\delta\subseteq f^{-1}(B_\varepsilon(f(x)))\text{.}\) So for all \(n\geq N, f(x_n)\in B_\varepsilon(f(x))\text{.}\) Hence \(\lim_{n\rightarrow\infty}f(x_n)=f(x)\text{.}\)
(3\(\implies\)2) Let \(x_0\in X\) be a cluster point. If \((x_n)_{n=1}^\infty X\setminus\{{x_0}\}\text{,}\)\(\lim_{n\rightarrow \infty}x_n=x_0\text{,}\) then by 3 \(\lim_{n\rightarrow\infty}f(x_n)=f(x_0)\text{.}\) By earlier result, this implies \(\lim_{x\rightarrow x_0}f(x)=f(x_0).\)
(2\(\implies\)1) We know that \(f\) is continuous at each isolated point in \(X\text{.}\) Suppose then that \(x_0\in X\) is a cluster point. Fix \(\varepsilon>0\text{.}\) By 2, \(\lim_{x\rightarrow x_0}f(x)=f(x_0)\text{,}\) and so exists \(\delta>0\) so that for all \(x\in B_\delta (x_0)\setminus\{{x_0}\}\text{,}\) we have \(d(f(x), f(x_0))<\varepsilon\text{.}\) Also holds if \(x=x_0\text{.}\) So for all \(x\in B_\delta (x_0),d(f(x), f(x_0))<\varepsilon\) so \(f\) is continuous.
Example4.92.
Let \(S^2=\{{(x,y,z)\in\mathbb{R}^3}\,:\,{x^2+y^2+z^2=1}\}\) is a closed subset of \(\mathbb{R}^3\text{.}\)
Let \(p:\mathbb{R}^3\rightarrow \mathbb{R}\) by \(p(x,y,z)=x^2+y^2+z^2\) is continuous. Also, \(\{{1}\}\subseteq \mathbb{R}\) is closed, so \(S^2=p^{-1}(\{{1}\})\) is closed.
Theorem4.93.
If \(X\) and \(Y\) are metric spaces, \(X\) is compact, and \(f:X\rightarrow Y\) is continuous, then \(f(X)\subseteq Y\) is compact.
Corollary4.94.
Let \(f:X\rightarrow Y\) be a continuous function between metric spaces and assume \(X\) is compact. Then if \(F\subseteq X\) is closed, we have \(f(F)\subseteq Y\) is also closed.
If \(X\) is compact and \(F\subseteq X\) is closed, then \(F\) is compact (closed subset of a compact space). Then \(f(F)\subseteq Y\) is compact by the previous result. So \(f(F)\) is closed.
Corollary4.95.
Suppose \(X\) and \(Y\) are metric spaces and \(f:X\rightarrow Y\) is a continuous bijection. If \(X\) is compact, then \(f^{-1}\) is continuous.
Let \(g=f^{-1}:Y\rightarrow X\text{.}\) If \(F\subseteq X\) is closed, then the preimage of \(F\) under \(g,g^{-1}(F)\subseteq Y\) equals \(f(F)\subseteq Y\text{.}\) So \(g^{-1}(F)\) is closed by the previous corollary. Hence \(g\) is continuous.
Theorem4.96.Extreme Value Theorem.
If \(X\) is a nonempty compact metric space and \(f:X\rightarrow \mathbb{R}\) is continuous, then there are points \(x_1,x_2\in X\) such that
\begin{equation*}
f(x_1)=\sup_{x\in X}f(x)\text{ and }f(x_2)=\inf_{x\in X}f(x).
\end{equation*}
We know that \(f(X)\) is compact and in particular is closed and bounded. Since \(f(X)\) is bounded and nonempty, \(a:=\sup f(x)\in \mathbb{R}\text{.}\) Then there is a sequence \((t_n)_{n=1}^\infty\subseteq f(X)\) with \(\lim_{n\rightarrow\infty} t_n=a\) (indeed for \(n\in \mathbb{Z}_+\text{,}\) choose \(t_n\in f(X)\) with \(t_n>a-\frac{1}{n}\text{.}\) Then since \(a-\frac{1}{n}<t_n\leq a\text{,}\) we have \(t_n\rightarrow a\text{.}\)) Since \(f(X)\) is closed and \(t_n\in f(X)\) for all \(n\geq 1,\) we have \(a\in f(X)\text{.}\) Now, fix \(x_1\in X\) with \(f(x_1)=a\text{.}\) Note that \(-f:X\rightarrow \mathbb{R}\) is continuous, so exists \(x_2\in X\) with \(-f(x_2)=\sup_{x\in X}(-f(x))=-\inf_{x\in X}f(x)\text{.}\)