---
# System prepended metadata

title: '571: Ch 4 Continuity'
tags: ['571']

---

571: Ch 4 Continuity
===
###### tags: `571` `MAT571`

# Continuity

## Definition of Continuity

**Definition (continuity):** Let $(X,\tau_X)$ and $(Y,\tau_Y)$ be two topological spaces, then $f:X\to Y$ is *continuous* iff $f^{-1}(\tau_Y) \subseteq \tau_X$. 

Stated a little bit differently: $f:X\to Y$ is continuous iff for any open $O\subseteq Y$, $f^{-1}(O)$ is open (in $X$).

**Definition (continuity at a point):** If $f:X\to Y$, then $f$ is continuous at $x$ iff for all open neighborhoods $O$ of $f(x)$, there is an open neighborhood $U$ of $x$ so that $f(U) \subseteq O$.

**Warning**: It is important to note that if $f:D\subseteq X\to Y$, then we call $f$ continuous on $D$ if $f$ is continuous as a function from $D$ to $Y$ and so the induced topology on $D$. So we have:
* $f:D\subseteq X\to Y$is continuous iff for all open $O\subseteq Y$, there is an open $U\subseteq X$, so that $f(D\cap U)\subseteq O$. 
* $f:D\subseteq X\to Y$ is continuous at $x$ iff for all open nbhds $O$ of $f(x)$, there is an open nbhd $U$ of $x$ so that $f(D\cap U)\subset O$.
* $f:D\subseteq X\to Y$ is continuous iff it is continuous at all $x\in D$. 

**Example** (One that causes confusion in calculus texts) $f:[0,\infty)\to \mathbb R$ given by $f(x)=\sqrt{x}$ is continuous, in particular it is continuous at $x=0$.

**Example:** Any $f:\mathbb{Z}\to\mathbb{R}$ is continuous. In fact if $D$ is any discrete set then any $f:D\to X$ is continuous. This is because $f^{-1}(A)$ is open for any $A\subseteq X$ since all subsets of $D$ are open since $D$ is discrete.

In the case that $f:X\to Y$ and $X$ and $Y$ are metric spaces, $O$ can be replaced by $N_{\epsilon}^Y(f(x))$ and $U$ can be replaced by $N_{\delta}^X(x)$, so that continuity at a point becomes: 

**Definition (continuity at a point in metric spaces):** 
* $f$ is continuous at $x$ iff for all $\epsilon > 0$, there is a $\delta>0$, so that for all $x'$, 
  $$
  x'\in N_{\delta}(x)^X \implies f(x')\in N_{\epsilon}^Y(f(x))
  $$

* The preceding can be written as $f$ is continuous at $x$ iff for all $\epsilon > 0$, there is a $\delta>0$, so that for all $x'$, 
 $$
 d_X(x',x)<\delta \implies d_Y(f(x'),f(x))<\epsilon
 $$

**Lemma:** If $f:X\to Y$ is continuous at all $x\in X$, then $f$ is continuous.

**Proof.** Let $O$ be an open set in $Y$, it must be shown that $f^{-1}(O)$ is open. Let $x\in f^{-1}(O)$ and let $U$ be an open set in $X$ so that $x\in U$ and $f(U)\subseteq O$, so that $x\in U \subseteq f^{-1}(O)$. This shows that $f^{-1}(O)$ is indeed open.
❏

As usual, $f:X\to Y$  is *continuous on $E\subseteq X$* iff $f:E\to Y$ is continuous where $E$ is given the inherited subspace topology. (Recall: This means $A\subseteq E$ is open iff there is open $O\subseteq X$ so that $A=E\cap O$.)  



**Example:** $f:\mathbb{R}-\{0\}\to\mathbb{R}$ defined by $f(x)=1/x$ is continuous on its domain. Take any open interval $(a,b)$, then there are two cases. Case 1 is that $0\in(a,b)$ in which case $f^{-1}(a,b)=(-\infty,1/a)\cup(1/b,\infty)$, which is open. Case 2 is that $0\not\in (a,b)$ in which case $f^{-1}(a,b)=(1/b,1/a)$. Now we have shown that $f^{-1}((a,b))$ is open for any open interval $(a,b)$. But for any open set, $O\subseteq \mathbb{R}$, $O=\bigcup_{i\in I}(a_i,b_i)$ for some index set $I$ and thus $f^{-1}(O)=\bigcup_{i\in I}f^{-1}((a_i,b_i))$ which is a union of open subsets of $\mathbb{R}-\{0\}$ and hence is itself open.

**Theorem** Suppose $f:X\to Y$ and $Y$ is $T_2$. If $f$ is continuous, then $\text{Graph}(f)$ is closed.

**Proof** Suppose $(x,y)\not\in\text{Graph}(f)$, so $f(x)=y'\neq y$. Get $O$ and $O'$ open nbhds of $y$ and $y'$ in $Y$ so that $O\cap O'=\emptyset$. Let $U=f^{-1}(O')$. Then $(x,y)\in (U\times O)\cap \text{Graph}(f)=\emptyset$ since for all $x'\in U$, $f(x')\in O'$ and hence $f(x')\not\in O$. 
❏

**Definition (sequential continuity):** A function $f:X\to Y$ is *sequentially continuous* if whenever $x_i\to x$, then $f(x_i)\to f(x)$. 

**Theorem:** If $f:X\to Y$ continuous at $x$, then $f$ is sequentially continuous at $x$. 

**Proof.** We must show that if $x_i\to x$, then $f(x_i)\to f(x)$. Let $O$ be an open neighborhood of $f(x)$, then $f^{-1}(O)$ is open and hence there is $N>0$ so that $x_i\in f^{-1}(O)$ for $i>N$, thus $f(x_i)\in O$ for $i>N$ and hence $f(x_i)\to f(x)$.

As usual, if $X$ is a metric space, then the converse of the above also obtains.

**Theorem:** Suppose $X$ is a metric space and $Y$ is any topological space and $f:X\to Y$, then sequential continuity of $f$ implies continuity of $f$.

**Proof:** Suppose towards a contradiction that $f:X \to Y$ is sequentially continuous and not continuous at $x$. This means that there is an open set $O\subseteq Y$ with $x\in O$ so that for all $\delta > 0$ there is $x'\in N_{\delta}(x)$ so that $f(x')\not\in O$. We can thus pick $x_i\in N_{1/i}^X(x)$ so that $x_i\to x$ and yet $\{f(x_i)\mid i\in\mathbb{N}\}\cap O=\emptyset$. This clearly contradicts sequential continuity.

**Restriction to subsets:** All of the above also holds when $f$ is restricted to a set $E\subseteq X$ since $f$ is continuous/sequentially continuous iff $f:E\to Y$ is likewise where $E$ is given the induced subspace topology. 

**Remark:** It is perhaps a subtle point that continuity, continuity at a point, sequential continuity, etc., depends on the domain of $f$ or the set $E$ in consideration.

## Homeomorphism

**Definition (homeomorphism):** Two topological spaces $X$ and $Y$ are called *isomorphic* if there is a bijection $f:X\to Y$ so that both $f$ and $f^{-1}$ are continuous. When discussing topologies, the word *homeomorphic* is used. 

Basically, two homeomorphic spaces are exactly the same up to relabeling of the points. In particular, $f^{-1}(\tau_Y)\subseteq \tau_X$ and also $f(\tau_X)\subseteq \tau_Y$ and hence $\tau_X=f^{-1}(f(\tau_X))\subseteq f^{-1}(\tau_Y)$. Thus we have $f^{-1}(\tau_Y)=\tau_X$ and similarly, $f(\tau_X)=\tau_Y$ so the open sets are also the same up to relabeling.

We have already seen this concept used. Namely, any two completions of a metric space $X$ are homeomorphic. In fact, for metric spaces there is a stonger notion:

**Definition (isometry):** Two metric spaces $X$ and $Y$ are *isomometric* iff there is a bijection $f:X\to Y$ that preserves distance, i.e., $d(a,b)=d_Y(f(a),f(b))$. 

**Note:** $f^{-1}$ also preseves the metric, since if $f(x)=a$ and $f(y)=b$, $d_Y(a,b)=d(x,y)=d(f^{-1}(a),f^{-1}(b))$.

Isometry is strictly stronger than homeomorphic. For example, $\mathbb{C^n}$ has different metrics determined by the $p$-norms $||x||_p$, for $1\leq p \leq\infty$. All of these metrics result in the same topology, recall the "balls" $B_\delta(x)$ in $||\cdot||_1$ are "diamonds" centered at $x$ whereas in $||\cdot||_2$ they are the standard Euclidean balls and in $||\cdot||_\infty$, they are "cubes". However, none of these spaces are isometric to one another. 

**Notation:** Write $X\simeq Y$ for "$X$ and $Y$ are homeomorphic" and $X\underset{\tiny{\text{iso}}}{\simeq}Y$ for "$X$ and $Y$ are isometric". Both these relations are equivalence relations on the category of topological spaces/metric spaces respectively.

## Compactness and continuity

**Theorem:** If $f:X \to Y$ is continuous and $X$ is compact, then $f(X)$ is also compact. 

**Proof:** Let $\mathcal{O}$ be an open cover of $f(X)$. Then $\mathcal{U}=f^{-1}(\mathcal{O})$ is an open cover of $X$ and hence has a finite subcover $\mathcal{U}_0$. So $\{O \mid f^{-1}(O) \in \mathcal{U}_0\}$ is a finite subcover of $f(X)$. Hence, $X$ is compact. 
❏

**Corollary:** If $f:X\to Y$, $X$ compact, and both $X$ and $Y$ are Hausdorff ($T_2$), then $f$ maps closed sets to closed sets. Such an $f$ is called a *closed mapping*.  If in addition, $f$ is onto, then $f$ is an open mapping, i.e., $f$ maps open sets to open sets. 

**Proof:** The first part follows simply from the fact that compact sets are closed in $T_2$ spaces. For the second part, since $f$ is onto we have $Y-f(A)=f(X-A)$. In general, onto not required, it is true that $f(X-A)\subseteq Y-f(A)$ since $y\in f(X-A) \implies y = f(x)$ for $x \not\in A \implies y\not\in f(A)$. If $f$ is onto, then all the implications can be reversed. 
❏

**Corollary** (*Open mapping theorem* for functions with compact support) Any continuous surjective map from a compact space into a $T_2$-space is open.

**Corollary:** If $f:X\to Y$ is 1-1 and $X$ is compact and $X,Y$ are $T_2$. Then $X\simeq f(X)$. 

**Proof:** We might as well assume $Y=f(X)$ else just rename $Y$. $f$ is an open mapping, but this is precisely what is required for $f^{-1}$ to be continuous. This is a kind of *automatic continuity* for $f^{-1}$ when $X$ is compact.
❏

**Corollary** (*Closed graph* theorem for functions with compact support) For $f:X\to Y$ with $X$ compact and both $X$ and $Y$ Hausdorff, 
$$
f\text{ is continuous} \iff \text{Graph}(f)\text{ is closed }
$$


**Proof** One direction is just a special case of a previous result. For the other direction suppose $\text{Graph}(f)$ is closed, $f(X)$ is compact and hence $X\times f(X)$ is compact and $\text{Graph}(f)\subseteq X\times \text{Graph}(f)$ is compact. The projection map $p_1:\text{Graph}(f)\to X$ given by $p_1((x,y))=x$ is a continuous bijective map and hence $p_1^{-1}:X\to \text{Graph}(f)$ is continuous. But then $f(x)=p_2\circ p_1^{-1}(x)$ is a composition of continuous maps and is hence continuous.
❏

Notice that if $X$ and $Y$ are metric with $X$ compact, then to show $f:X\to Y$ is continuous it would suffice to take $x_i\in X$ with $x_i\to x$ and show that 
1. $f(x_i)\to y$ for some $y$ and
2. $f(x)=y$

With the closed graph theorem this reduces to taking $x_i, y_i$ so that $f(x_i)=y_i$ and $(x_i,y_i)\to (x,y)$ and showing that $f(x)=y$. That is, we can avoid arguing for (1.).

## Connectedness and continuity

**Theorem** If $f:X\to  Y$ is continuous and $X$ is connected, then $f(X)$ is connected. 

**Proof:** Suppose $U,V$ disconnect $f(X)$, then $f^{-1}(U), f^{-1}(V)$ would disconnect $X$.

This immediately gives the *intermediate value formula* in a variety of forms. 

**Lemma** $A\subseteq \mathbb R$ is connected iff $A$ is an interval.

**Proof** Notice that $A$ is an interval iff for all $a\leq b$ in $A$, for all $c$, $a< c< b\implies c\in A$. 

If $A$ fails to be an interval, then there is $a\le b$ in $A$ and $c$ such that $a<c<b$ and $c\not\in A$. But then $U=A\cap (-\infty, c)$ and $V=A\cap (c,\infty)$ satisfy, $U\cup V=A$, $U\cap V=\emptyset$, $U,V$ are open in $A$, and $A\cap U\neq\emptyset\neq A\cap V$. Thus $A$ is disconnected. 

Conversely, suppose $A$ is an interval and $U,V$ are open in $A$ with $U\cap V=\emptyset$, $U\cap A\neq\emptyset\neq V\cap A$, and $U\cup V=A$. Take $a_1\in U\cap A$ and $b_1\in V\cap A$. Assume WLOG that $a_1<b_1$. Let $c_1=(a_1+b_1)/2$. If $c_1\in U$, then let $a_2=c_1$ and $b_2=b_1$. Else $c_1\in V$ and we let $b_2=c_1$ and $a_2=a_1$. Either way we have $[a_2,b_2]\subset[a_1,b_1]$. Let $c_2=(a_2+b_2)/2$, get $[a_3,b_3]\subset [a_2,b_2]$, etc. This way we build $a_1\le a_2\le a_3\le \cdots \le b_3\le b_2\le b_1$ where $|b_i-a_i|=(b_1-a_1)/2^{i-1}$ so $a_i,b_i\to c$. Clearly, $c\in\text{Cl}(U)\cap\text{Cl}(V)=U\cap V$ since $U$ and $V$ are clopen in $A$. But this contradicts, $U\cap V=\emptyset$.
❏

**Corollary** Let $X$ be connected and $f:X\to \mathbb R$, then $f(X)$ is an interval.

**Example:** Suppose $f:S_2\to \mathbb{R}$ is continuous where $S_2\subset\mathbb{R}^3$ is the unit sphere, surface of the unit ball, $S_2(0)=\partial N_1(0)$. Set $g(x)=f(x)-f(x')$ where $x'$ is the point on $S_2$ that is the polar opposite (antipode) of $x$. Then either $g(x)=0$ in which  case we have $x$ and $x'$ antipodal points on $S_2$ so that $f(x)=f(x')$. Else $g(x') = f(x')-f(x)=-g(x)$ so if $g(x)\neq 0$, then $g(x)$ and $g(x')$ have opposite signs. Since $S_2(0)$ is connected, $g(S_2)$ is connected and thus $0\in g(S_2)$, so $g(y)=f(y)-f(y')=0$ for some $y$. 

## Uniform continuity and continuous extensions

If $X$ and $Y$ are metric spaces, continuity can be strengthened. In this secion and whenever discussing *uniform continuity*, assume the spaces are metric.

**Definition:** $f:X \to Y$ is *uniformly continuous* iff for all $\epsilon > 0$, there is a $\delta > 0$, so that for all $x_1,x_2\in X$, 
$$
d(x_1,x_2)<\delta\implies d_Y(f(x_1),f(x_2))<\epsilon.
$$ 

Stated another way this says that for all $\epsilon>0$, there is a $\delta>0$ so that $f(N_{\delta}(x))\subset N_{\epsilon}(f(x))$ for all $x\in X$.

Notice that the difference here from continuity is that in continuity, the $\delta$ depends on $x$, here the $\delta$ works **unifomly** for all $x$ at once. The difference in continuity and uniform continuity is a nice example of "interchanging" positions of quantifiers: "$\forall x\,\exists \delta$" is changed to "$\exists \delta\,\forall x$" 

| **Continuity** |$\forall \epsilon > 0\,\forall x\,\exists \delta\, \forall x'\,(d(x,x')<\delta\implies d_Y(f(x),f(x'))<\epsilon)$|
|:---------:|:---------------:|
|**Uniform Continuity** |$\forall \epsilon > 0\,\exists \delta\, \forall x, x'\,(d(x,x')<\delta\implies d_Y(f(x),f(x'))<\epsilon)$|


A very important property of uniformly continuous functions is that they preserve Cauchy sequences.

**Theorem:** Let $f:X \to Y$ be uniformly continuous and $(x_i)$ be a C-seq, then $(f(x_i))$ is a C-seq.

**Proof:** Fix $\epsilon>0$, then find $\delta$ so that $d(x,x')<\delta\implies d_Y(f(x),f(x'))<\epsilon$. Let $N>0$ be so that $d(x_i,x_j)<\delta$ for $i,j>N$, then $d_Y(f(x_i),f(x_j)<\epsilon$ for $i,j>N$. So $(f(x_i))$ is a C-seq.

This provides an easy way to show some functions are not uniformly continuous. For example $f(x)=1/x$ takes the C-seq $(1/i)$, to the non C-seq $(i)$ and hence it follows that $f$ is not uniformly continuous, but $f:\mathbb{C}^*\to \mathbb{C}$ is continuous, where as usual $\mathbb{C}^*=\mathbb{C}-\{0\}$.

**Theorem:** If $X$ is compact and $f:X \to Y$, then $f$ is continuous iff $f$ is uniformly continuous.

**Proof:** The "if" direction is trivial since uniform continuity is stronger than continuity. For the "only-if" direction argue as follow: Fix $\epsilon > 0$. For each $x$ get $\delta_x$ as in the definition for continuity for $\epsilon/2$. This provides an open cover $N_{\delta_x/2}(x)$ of $X$. There is a finite open subcover $N_{\delta_{x_i}/2}(x_i)$ for $x_1,...,x_n$. Let $\delta=\min\{\delta_{x_i}/2\mid i=1,2,...n\}$. Then for any $x,x'$ so that $d(x,x')<\delta$ we have an $x_i$ so that $d(x,x_i)<\delta_{x_i}/2$ and hence $d(x',x_i)\leq d(x,x')+d(x,x_i)<\delta_{x_i}$. So $d_Y(f(x),f(x'))\leq d_Y(f(x),f(x_i))+d_Y(f(x'),f(x_i))<\epsilon$. This is as required for uniform continuity.

**Theorem:** Let $E$ a dense subset of the metric $X$. Suppose $f:E \to Y$ is uniformly continuous and assume $Y$ is complete. Then there is a unique extension $\hat f:X \to Y$. 

**Proof:** Let $x \in X$. There is a sequence $(x_i)$ so that $x_i\to x$. The sequence $(x_i)$ is a C-seq and thus $(f(x_i))$ is a C-seq in $Y$. Since $Y$ is complete $f(x_i)\to y$ and we define $\hat f(x)=y$. We must show this is well defined, so if $x_i\to x$ and $x'_i\to x$, then we need to know $\lim_i f(x_i) = \lim_i f(x'_i)$. But this follows as $x''_{2i} = x_i$ and $x''_{2i+1}=x'_i$ gives a C-seq containing both $(x_i)$ and $(x'_i)$ and thus $f(x''_i)\to y$ and as $(f(x_i))$ and $(f(x'_i))$ are sub-C-seqs in side $(f(x''_i))$ they both approach the  same limit $y$. 


The preceding can be extended by "gluing together" unique extensions on sets where $f$ is uniformly continuous as in the following example.

**Example:** For $a>1$, define $f(r)=(a^n)^{1/m}$ where $r=n/m\ge 0$ and $n,m$ have no prime in common. Note that $|a^r-a^{r'}|=|a^r||1-a^{r'-r}|$. We know $a^d\to 1$ as $d\to 0$ (see below). So by taking $0<r'<r$ so that $r-r'<\delta_r$ we can guarantee that $|1 - a^{r'-r}|<\epsilon/|a^r|$. Thus for each $r\in \mathbb{Q}\cap [0,\infty)$ we get $\delta_r$ so that for all $|r'-r''|<\delta_r$, $|a^{r'}-a^{r''}|<|a^{r'}||1 - a^{r''-r'}|< \epsilon$. So $f$ is uniformly continuous on $\mathbb{Q}\cap[0,r]$ and thus $f$ can be uniquely extended to $\hat f_r:[0,r] \to \mathbb{R}$. The extensions $\hat f_r$ can then be "glued together" to give $\hat f=\bigcup_r \hat f_r$ so that $f(x)=a^x$ is defined and continuous for all $a>1$ and $x\in \mathbb{R}\cap[0,\infty)$. Finally, $\hat f(-x)$ is defined as $1/\hat f(x)$ and this defines $f(x)=a^x$ for all $x\in\mathbb{R}$. 
 
## Additional properties of metric spaces

**Theorem** Let $X$ be a metric space. The metric $d:X\times X \to [0,\infty)$ is continuous. 

**Proof** For let $(x,y)\in X\times X$ and $\epsilon>0$. Take $(x',y')$ so that $d(x,x')<\epsilon/2$ and $d(y,y')<\epsilon/2$, then $d(x,y)\leq d(x,x')+d(x',y)\leq d(x,x')+d(x',y')+d(y,y')$ so $d(x,y)-d(x',y')\leq d(x,x')+d(y,y')<\epsilon$. Similarly swapping the rolls of $x$ and $y$ with $x'$ and $y'$ we get

$$
(x',y') \in N_{\epsilon/2}(x)\times N_{\epsilon/2}(y) \implies |d(x,y) - d(x',y')|<\epsilon.
$$


Thus $d:X\times X\to [0,\infty)$ is continuous.
❏

Now let $F$ a closed subset of $X$. Let $d(x,F)=\min\{d(x,y)\mid y\in F\}$. The function $f(x)=d(x,F)$ is continuous and the zero set $Z(f)=F$. Clearly, if $x\in F$, then $d(x,F)=0$. On the other hand, if $x\not\in F$, then $N_{\delta}(x)\cap F=\emptyset$ for some $\delta>0$ and thus $d(x,F)\ge\delta>0$. To see that $f$ is continuous let $\epsilon>0$ and $d(x,x')<\epsilon$, then 

$$
d(x',F)=\min\{d(x',y)\mid y\in F\}\leq \min\{d(x,x')+d(x',y)\mid y\in F\}
$$ 

and so $d(x',F)\leq d(x,x')+d(x,F)<d(x,F)+\epsilon$.
Again we could reverse the rolls of $x$ and $x'$, thus getting

$$
d(x,x')<\epsilon\implies |d(x,F)-d(x',F)|<\epsilon
$$

so $f(x)=d(x,F)$ is continuous. 

This essentally proves:

**Theorem:** If $X$ is a metric space and $x\in X$ and $F\subseteq X$ is closed with $x\not\in F$, then there is a continuous $f:x\to[0,1]$ so that $x\in f^{-1}(1)$ and $F\subseteq f^{-1}(0)$. 

**Proof.** Just take $f(y)=\frac{d(y,F)}{d(x,F)}$.

**Definition:** A topological space space with the property that for every point $x$ and closed set $F$ there is $f\in C(X,[0,1])$ so that $f(x)=1$ and $f(F)={0}$ is called *completely regular*.  

**Theorem:** A completely regular space $X$ with a countable base is metrizable.

**Proof.** Let $\{U_i \mid i\in \mathbb{N}\}$ be the countable base and let $x_i\in U_i$ so $\{x_i\mid i\in\mathbb{N}\}$ is dense. Let $f_i:X\to[0,1]$ separate $x_i$ and $F_i=X-U_i$. Then $\pi:X\to [0,1]^{\mathbb{N}}$ defined by $\pi(x)=(f_i(x))_i$ is continuous. Moreover, if $x\neq x'$ in $X$, then $x\in U_i$, $x'\not\in U_i$ so $f_i(x)\neq 0$ while $f_i(x')=0$, so $f$ is 1-1. Thus $X$ is homeomorphic to a subset of $[0,1]^{\mathbb{N}}$ and hence inherits the metric from $[0,1]^\mathbb{N}$. 

Metric spaces have yet more separation. 

**Definition:** A space is $T_3$ or *regular* iff whenever $x\in X$ and $F$ is closed with $x\not\in F$, then there are open $U$ and $V$ so that $x\in U$, $f\subseteq V$, and $U\cap V=\emptyset$. 

**Corollary:** Metric spaces are regular.

**Definition:** A space is $T_4$ or *normal* if any two disjoint closed sets can be separated by disjoint open sets.

**Theorem:** Metric spaces are normal.

**Proof.** Let $F$ and $F'$ be the two disjoint sets. For each $x\in F$ we have $d(x,F')>0$ so consider $\delta_x=d(x,F')/3$ and similarly for $x\in F'$. Let $U=\bigcap_{x\in F}B{\delta_x}(x)$ and $U'=\bigcap_{x\in F'}B{\delta_x}(x)$. We have $F\subseteq U$, $F'\subseteq U'$, and if $z\in U\cap U'$, then $z\in B{\delta_x}(x)$ for some $x\in F$ and $z\in B{\delta_{x'}}(x')$ for some $x'\in F'$. But then 
$$
\begin{split}
d(x,F'),d(x',F)\leq d(x,&x')\leq d(x,z)+d(z,x')\\
&<\delta_x+\delta_{x'}=d(x,F')/3 + d(x',F)/3 \\
&< \max\{d(x',F),d(x,F')\}.
\end{split}
$$ 

This is a contradiction.

## Monotone functions 

This is a sort of fun subtopic, that has nice applications in probability. Here we restrict to functions $f:I\to\mathbb R$ where $I$ is an open interval (open connected set in $\mathbb R$). For $x\in I$ we can take limits from the left and right of $x$:
$$
\lim_{a\to x^-}f(a)=f(x-)=L\underset{def}{\iff}\forall \epsilon>0\exists\delta >0(x-\delta<a<x\implies |f(a)-L|<\epsilon)
$$
Similarly, define $\lim_{a\to x^+}f(a)=f(x+)$. 

**Claim** $\lim_{a\to x}f(a)=L\iff f(x-)=L=f(x+)$

Similarly, $f$ is ***continuous at $x$ from the left*** iff $f(x-)=f(x)$ and ***continuous at $x$ from the right*** iff $f(x+)=f(x)$. Clearly, $f$ is continuous at $x$ iff it is continuous from the left and right. 

So if $f:I\to\mathbb R$ is discontinuous at $x$, there ate two possibilities:
* (***simple discontinuity***) Both $f(x+)$ and $f(x-)$ exist and $f(x-)\neq f(x+)$.
* One or both of $f(x-)$ and $f(x+)$ does not exist.

**Definition** $f:I\to\mathbb R$ is ***increasing*** iff for all $a<b$ from $I$, $f(a)\le f(b)$. If we replace "$f(a)\le f(b)$" with "$f(a)<f(b)$," then we say that ***$f$ is strictly increasing***. similarly define ***decreasing*** and ***strictly decreasing***. A function that is increasing or decreasing is said to be ***monotonic*** or ***strictly monotonic***. 

**Fact** Discontinuities of monotonic functions are always of the simple sort. 

**Proof** This follows easily. Assume WLOG that $f$ is increasing and $x\in I$. (Recall $I$ is an open interval.) 
 $$
 \{f(a)\mid a<x\wedge a\in I\}\le f(x)\le \{f(b)\mid x<b\wedge b\in I\},
$$ 
so 
$$
\sup(\{f(a)\mid a<x\wedge a\in I\})=f(x-)\le f(x)\le f(x+)=\inf(\{f(b)\mid x<b\wedge b\in I\})
$$

**Corollary** Monotonic functions can have at most countably many discontinuities.

**Proof** For any $x$ that is a discontinuity we have $f(x-)<f(x+)$ (in the case $f$ is increasing). Let $q_x\in(f(x-),f(x+))\cap\mathbb Q$. Clearly if $x<x'$ are discontinuities, then $q_x<q_{x'}$, so there is an injection from the discontinuities of $f$ into $\mathbb Q$. 

**Corollary** A monotonic function $f:I\to\mathbb R$ is continuous iff $f(I)$ is connected. 

**Proof** The "only if" ($\Rightarrow$) part is trivial since the image of a connected set is connected.

The "if" ($\Leftarrow$) part is also trivial since if $x$ is a discontinuity, then $f(x-)<f(x+)$ (in the increasing case) and thus $f(I)=((-\infty,f(x-)]\cup\{f(x)\}\cup [f(x+),\infty))\cap f(I)$
❏

## Interesting cases of continuous functions:

* [The Cantor function](https://en.wikipedia.org/wiki/Cantor_function)
* [The Weierstrass function](https://en.wikipedia.org/wiki/Weierstrass_function)
* [Hlbert curve](https://en.wikipedia.org/wiki/Hilbert_curve) Here is a [3Blue1Brown](https://youtu.be/3s7h2MHQtxc) video with an application of this strange beast.