$\newcommand{\br}{\\}$ $\newcommand{\R}{\mathbb{R}}$ $\newcommand{\Q}{\mathbb{Q}}$ $\newcommand{\Z}{\mathbb{Z}}$ $\newcommand{\N}{\mathbb{N}}$ $\newcommand{\C}{\mathbb{C}}$ $\newcommand{\P}{\mathbb{P}}$ $\newcommand{\F}{\mathbb{F}}$ $\newcommand{\L}{\mathcal{L}}$ $\newcommand{\spa}[1]{\text{span}(#1)}$ $\newcommand{\dist}[1]{\text{dist}(#1)}$ $\newcommand{\max}[1]{\text{max}(#1)}$ $\newcommand{\min}[1]{\text{min}(#1)}$ $\newcommand{\supr}[1]{\text{sup}(#1)}$ $\newcommand{\infi}[1]{\text{inf}(#1)}$ $\newcommand{\ite}[1]{\text{int}(#1)}$ $\newcommand{\ext}[1]{\text{ext}(#1)}$ $\newcommand{\bdry}[1]{\partial #1}$ $\newcommand{\argmax}[1]{\underset{#1}{\text{argmax }}}$ $\newcommand{\argmin}[1]{\underset{#1}{\text{argmin }}}$ $\newcommand{\set}[1]{\left\{#1\right\}}$ $\newcommand{\emptyset}{\varnothing}$ $\newcommand{\tilde}{\text{~}}$ $\newcommand{\otherwise}{\text{ otherwise }}$ $\newcommand{\if}{\text{ if }}$ $\newcommand{\proj}{\text{proj}}$ $\newcommand{\union}{\cup}$ $\newcommand{\intercept}{\cap}$ $\newcommand{\abs}[1]{\left| #1 \right|}$ $\newcommand{\norm}[1]{\left\lVert#1\right\rVert}$ $\newcommand{\pare}[1]{\left(#1\right)}$ $\newcommand{\brac}[1]{\left[#1\right]}$ $\newcommand{\t}[1]{\text{ #1 }}$ $\newcommand{\head}{\text H}$ $\newcommand{\tail}{\text T}$ $\newcommand{\d}{\text d}$ $\newcommand{\limu}[2]{\underset{#1 \to #2}\lim}$ $\newcommand{\der}[2]{\frac{\d #1}{\d #2}}$ $\newcommand{\derw}[2]{\frac{\d #1^2}{\d^2 #2}}$ $\newcommand{\pder}[2]{\frac{\partial #1}{\partial #2}}$ $\newcommand{\pderw}[2]{\frac{\partial^2 #1}{\partial #2^2}}$ $\newcommand{\pderws}[3]{\frac{\partial^2 #1}{\partial #2 \partial #3}}$ $\newcommand{\inv}[1]{{#1}^{-1}}$ $\newcommand{\inner}[2]{\langle #1, #2 \rangle}$ $\newcommand{\nullity}[1]{\text{nullity}(#1)}$ $\newcommand{\rank}[1]{\text{rank }#1}$ $\newcommand{\nullspace}[1]{\mathcal{N}\pare{#1}}$ $\newcommand{\range}[1]{\mathcal{R}\pare{#1}}$ $\newcommand{\var}[1]{\text{var}\pare{#1}}$ $\newcommand{\cov}[1]{\text{cov}(#1)}$ $\newcommand{\cov}[2]{\text{cov}\pare{#1, #2}}$ $\newcommand{\tr}[1]{\text{tr}(#1)}$ $\newcommand{\oto}{\text{ one-to-one }}$ $\newcommand{\ot}{\text{ onto }}$ $\newcommand{\ceil}[1]{\lceil#1\rceil}$ $\newcommand{\floor}[1]{\lfloor#1\rfloor}$ $\newcommand{\Re}[1]{\text{Re}(#1)}$ $\newcommand{\Im}[1]{\text{Im}(#1)}$ $\newcommand{\dom}[1]{\text{dom}(#1)}$ $\newcommand{\fnext}[1]{\overset{\sim}{#1}}$ $\newcommand{\transpose}[1]{{#1}^{\text{T}}}$ $\newcommand{\b}[1]{\boldsymbol{#1}}$ $\newcommand{\None}[1]{}$ $\newcommand{\Vcw}[2]{\begin{bmatrix} #1 \br #2 \end{bmatrix}}$ $\newcommand{\Vce}[3]{\begin{bmatrix} #1 \br #2 \br #3 \end{bmatrix}}$ $\newcommand{\Vcr}[4]{\begin{bmatrix} #1 \br #2 \br #3 \br #4 \end{bmatrix}}$ $\newcommand{\Vct}[5]{\begin{bmatrix} #1 \br #2 \br #3 \br #4 \br #5 \end{bmatrix}}$ $\newcommand{\Vcy}[6]{\begin{bmatrix} #1 \br #2 \br #3 \br #4 \br #5 \br #6 \end{bmatrix}}$ $\newcommand{\Vcu}[7]{\begin{bmatrix} #1 \br #2 \br #3 \br #4 \br #5 \br #6 \br #7 \end{bmatrix}}$ $\newcommand{\vcw}[2]{\begin{matrix} #1 \br #2 \end{matrix}}$ $\newcommand{\vce}[3]{\begin{matrix} #1 \br #2 \br #3 \end{matrix}}$ $\newcommand{\vcr}[4]{\begin{matrix} #1 \br #2 \br #3 \br #4 \end{matrix}}$ $\newcommand{\vct}[5]{\begin{matrix} #1 \br #2 \br #3 \br #4 \br #5 \end{matrix}}$ $\newcommand{\vcy}[6]{\begin{matrix} #1 \br #2 \br #3 \br #4 \br #5 \br #6 \end{matrix}}$ $\newcommand{\vcu}[7]{\begin{matrix} #1 \br #2 \br #3 \br #4 \br #5 \br #6 \br #7 \end{matrix}}$ $\newcommand{\Mqw}[2]{\begin{bmatrix} #1 & #2 \end{bmatrix}}$ $\newcommand{\Mqe}[3]{\begin{bmatrix} #1 & #2 & #3 \end{bmatrix}}$ $\newcommand{\Mqr}[4]{\begin{bmatrix} #1 & #2 & #3 & #4 \end{bmatrix}}$ $\newcommand{\Mqt}[5]{\begin{bmatrix} #1 & #2 & #3 & #4 & #5 \end{bmatrix}}$ $\newcommand{\Mwq}[2]{\begin{bmatrix} #1 \br #2 \end{bmatrix}}$ $\newcommand{\Meq}[3]{\begin{bmatrix} #1 \br #2 \br #3 \end{bmatrix}}$ $\newcommand{\Mrq}[4]{\begin{bmatrix} #1 \br #2 \br #3 \br #4 \end{bmatrix}}$ $\newcommand{\Mtq}[5]{\begin{bmatrix} #1 \br #2 \br #3 \br #4 \br #5 \end{bmatrix}}$ $\newcommand{\Mqw}[2]{\begin{bmatrix} #1 & #2 \end{bmatrix}}$ $\newcommand{\Mwq}[2]{\begin{bmatrix} #1 \br #2 \end{bmatrix}}$ $\newcommand{\Mww}[4]{\begin{bmatrix} #1 & #2 \br #3 & #4 \end{bmatrix}}$ $\newcommand{\Mqe}[3]{\begin{bmatrix} #1 & #2 & #3 \end{bmatrix}}$ $\newcommand{\Meq}[3]{\begin{bmatrix} #1 \br #2 \br #3 \end{bmatrix}}$ $\newcommand{\Mwe}[6]{\begin{bmatrix} #1 & #2 & #3\br #4 & #5 & #6 \end{bmatrix}}$ $\newcommand{\Mew}[6]{\begin{bmatrix} #1 & #2 \br #3 & #4 \br #5 & #6 \end{bmatrix}}$ $\newcommand{\Mee}[9]{\begin{bmatrix} #1 & #2 & #3 \br #4 & #5 & #6 \br #7 & #8 & #9 \end{bmatrix}}$
Definition: Continuous Functions

$(X, d_X), (Y, d_Y). f: X \to Y$.

We say that $f$ is continuous at $x_0 \in X$ iff

$$\forall \epsilon > 0, \exists \delta > 0\text{ such that }d_X(x, x_0) < \delta \implies d_Y(f(x), f(x_0)) < \epsilon$$

We say that $f$ is continuous iff

$$\forall x \in X, f\text{ is continuous at }x$$

Remarks: Continuous maps

Continuous functions are also sometimes called continuous maps.

Remarks

If $f: X \to Y$ is continuous, and $K$ is any subset of $X$, then the restriction $f|_K: K \to Y$ of $f$ to $K$ is also continuous.

Proof
  </span>
</span>
<span class="proof__expand"><a>[expand]</a></span>

$f$ is continuous.

Then, $\forall x_0 \in X, f$ is continuous at $x_0$.

Since $\forall x_1 \in K, x_1 \in X$, $f$ is continuous on all $x_1$.

$f$ is continuous on $K$.

Theorem : Continuity Preserves Convergence (Point Case)

$(X, d_X), (Y, d_Y). f: X \to Y. x_0 \in X.$

Then the following three statements are logically equivalent:

  1. $f$ is continuous at $x_0$.

  2. $\forall (x^{(n)})^\infty_{ n =1} \subseteq X,$
    $\limu{ n }{ \infty } x^{(n)} = x_0$ with respect to the metric $d_X$,
    $\limu{ n }{ \infty } f(x^{(n)}) = f(x_0)$ with respect to the metric $d_Y$.

  3. For every open set $V \subset Y$ that contains $f(x_0)$, there exists an open set $U \subset X$ containing $x_0$ such that $f(U) \subseteq V$.

Proof
  </span>
</span>
<span class="proof__expand"><a>[expand]</a></span>

$(1 \implies 2)$

$\forall (x^{(n)})^\infty_{ n =1} \in X , \limu{ n }{ \infty } x^{(n)} = x_0.$ We have

$$\forall \delta > 0, \exists N \geq 1,\text{ such that } n \geq N \implies d_X(x, x_0) < \delta$$

Also $f$ is continuous at $x_0$. Then,

$$\forall \epsilon > 0, \exists \delta > 0, \text{ such that } d_X(x, x_0) < \delta \implies d_Y(f(x), f(x_0)) < \epsilon$$

Therefore,

$$\forall \epsilon > 0, \exists N \geq 1, \text{ such that } n \geq N \implies d_X(f(x), f(x_0)) < \epsilon$$

In conclusion,

$$\forall (x^{(n)})^\infty_{ n =1} \in X, \limu{ n }{ \infty } x^{(n)} = x_0 \implies \limu{ n }{ \infty }f(x^{(n)}) = f(x_0)$$

$(2 \implies 1)$

We have,

$$\forall \delta > 0, \exists N_1 \geq 1,\text{ such that } \forall n \geq N_1, \limu{ n }{ \infty } d_X(x_n, x_0) < \delta.$$

$$\forall \epsilon > 0, \exists N_2 \geq 1,\text{ such that } \forall n \geq N_2, \limu{ n }{ \infty } d_Y(f(x_n), f(x_0)) < \epsilon.$$

Choose $N = \max{N_1, N_2}$,

We have $\forall \delta > 0, $

Theorem : Continuity Preserves Convergence (General Case)

$(X, d_X)$, $(Y, d_Y)$. $f: X \to Y$.

Then the following four statements are equivalent:

  1. $f$ is continuous.

  2. $(x^{(n)})^\infty_{ n =1} \subseteq X$, $x_0 \in X$.
    $\limu{ n }{ \infty } x^{(n)} = x_0$ with respect to the metric $d_X$,
    $\limu{ n }{ \infty } f(x^{(n)}) = f(x_0) $ with respect to the metric $d_Y$.

  3. Whenever $V$ is an open set in $Y$, the set $\inv{ f }(V) := \set{ x \in X : f(x) \in V } $ is an open set in $X$.

  4. Whenever $F$ is a closed set in $Y$, the set $\inv{ f }(F) := \set{ x \in X : f(x) \in F } $ is a closed set in $X$.

Remarks

It may seem strange that continuity ensures that the inverse image of an open set is open.

One may guess instead that the reverse should be true, that the forward image of an open set is open; but this not true.

Corollary : Continuity Preserved by Composition

$(X, d_X), (Y, d_Y), (Z, d_Z).$

  1. If $f: X \to Y$ is continuous at a point $x_0 \in X$,
    and $g: Y \to Z$ is continuous at $f(x_0) \in Y$,
    then the composition $g \circ f : X \to Z$, defined by $g \circ f(x) := g(f(x))$, is continuous at $x_0$.

  2. If $f: X \to Y$ is continuous, and $g: Y \to Z$ is continuous, then $g \circ f : X \to Z$ is also continuous.

Example: Thomae's Function

$f: \R \to \R$, standard metric, defined by $$f(x)=\begin{cases} 0 &\text{ if }x \not \in \Q \br \frac{1}{n}&\text{ if }x \in \Q \end{cases}$$ is continuous $\forall x_0 \not \in \Q$ and discontinuous $\forall x_0 \in \Q$.