## Theorems

For some function $$f: [a, b] \rightarrow \mathbb{R}$$ continuous, the Extreme Value Theorem and Intermediate Value Theorem apply. More generally, for $$f: (X, d_x) \rightarrow (Y, d_y)$$ continuous, we get

• $$k \subset X$$ is compact $$\implies f(k) \subset Y$$ is compact.
• $$E \subset X$$ is connected $$\implies f(E)$$ is connected.

Recall that the Heine-Borel Theorem gives us $$k \subset \mathbb{R}^n \textrm{ compact } \iff K \textrm{ is closed and bounded}$$.

## Last Time

Def: $$(X,d)$$ metric space:

$$(X_n) \in X$$ seq. Say $$(X_n)$$ converges to $$x_0 \in X$$.If $$\forall \epsilon > 0, \exists N > 0$$ such that $$d(x_n, x_0) < \epsilon \forall n> N$$.

Def: $$f: (X, d_x) \rightarrow (Y, d_y)$$

We say $$f$$ is continuous at $$x_0 \in X$$ if $$\forall$$ sequence $$(x_n) \in X$$ that converges to $$x_0$$, we have $$(f(x_n)) \in Y$$ converges to $$f(x_0)$$.

## Continuity For Functions

Theorem: $$f: X \rightarrow Y$$ is continuous at $$x_0$$ $$\iff$$ $$\forall \epsilon > 0, \exists \delta > 0$$ such that $$d_x(x, x_0) < \delta \implies \delta_y(f(x), f(x_0)) < \epsilon$$.

Proof: (←): Given the above premise, let $$(x_n) \in X$$ be a sequence such that $$\lim x_n = x_0$$. We want to prove $$\lim f(x_n) \leq f(x_0)$$. In other words, $$\forall \epsilon > 0, \exists N > 0$$ such that $$d_y(f(x_n)-f(x_0)) < \epsilon\ \forall n > N$$

$$\exists \delta > 0$$ such that $$d_x(x, x_0) < \delta \implies d_y(f(x), f(x_0)) < \epsilon$$ by the premise.
$$\exists N > 0$$ such that $$d_x(x, x_0) < \delta$$ for any $$n>N$$ since $$\lim x_n = x_0$$

At this point, $$N$$ depends on $$\delta$$ and $$\delta$$ depends on $$\epsilon$$. $$\forall \epsilon > 0$$, we found $$N > 0$$ such that if $$n>N$$, then $$d_x(x_n, x_0) < \delta$$, meaning $$d_y(f(x_n), f(x_0)) < \epsilon$$.

The converse (ie. assuming the conclusion is false) is $$\exists \epsilon > 0$$ such that $$\forall \delta > 0$$ such that $$\forall \delta > 0$$, $$\exists x \in X$$ such that $$d(x, x_0) < \delta$$ but $$d(f(x), f(x_0)) \geq \epsilon$$

Let $$\delta = 1$$. $$\exists x_n \in X$$ such that $$d(x_1, x_0) < 1$$ but $$d(f(x_1), f(x_0)) \geq \epsilon$$
Let $$\delta = 1/n$$. $$\exists x_n \in X$$ such that $$d(x_1, x_0) < 1/n$$ but $$d(f(x_1), f(x_0)) \geq \epsilon$$

Consider $$(x_n)$$. We have $$\lim x_n = x_0$$ but $$f(x_n)$$ doesn’t converge to $$f(x_0)$$.

The converse: $$f: S \rightarrow \mathbb{R}, S \in \mathbb{R}$$. $$f$$ is continuous at $$x_0 \in S$$ if and only if $$\forall \epsilon > 0, \exists \delta > 0$$ such that $$\vert x - x_0 \vert < \delta$$ implies that $$\vert f(x) - f(x_0) \vert < \epsilon$$.

### Example 1

Prove that $$f$$ is not continous at $$x=2$$.

$f(x) = \begin{cases} x, & x \neq 2\\ 3, & x=2\\ \end{cases}$

Intuition: If we take an delta-neighborhood around $$x=2$$, we will see there exists no points around it in the image.

Proof: Take $$\epsilon = 1/2$$. $$\forall \delta > 0, \exists x \in \mathbb{R}$$ such that $$\vert x - 2 \vert < \delta$$, but $$\vert f(x) - 3 \vert > 1/2$$.

### Example 2

Let $$f(x) = x$$. We want to show that it is continuous everywhere.

Proof: $$\forall x_0 \in \mathbb{R}$$, $$\forall \epsilon > 0$$, take $$\delta = \epsilon$$. Then, $$\vert x-x_0 \vert < \delta = \epsilon \implies \vert f(x) - f(x_0) \vert < \epsilon$$

### Example 3

Let $$f(x) = x^2$$. We want to show that it is continuous everywhere.

Proof: $$\forall x_0 \in \mathbb{R}$$, $$\forall \epsilon > 0$$, we want to find $$\delta > 0$$ such that if $$\vert x - x_0 \vert < \delta$$, then $$\vert x^2 - x_0^2 \vert < \epsilon$$.
Notice that $$\vert x^2 - x_0^2 \vert = \vert x - x_0 \vert \vert x + x_0 \vert$$.

Take $$\delta = \min(\frac{\epsilon}{y \vert x_0 \vert}, \vert x_0 \vert)$$. We get $$\vert x - x_0 \vert < \delta \leq \vert x_0 \vert$$, and $$\vert x + x_0 \leq \vert x-x_0 \vert + 2 \vert x_0 \vert \leq 3\vert x_0 \vert$$.
Then, $$\vert x - x_0 \vert \vert x + x_0 \vert$$ $$< \delta * 3 \vert x_0 \vert \leq \frac{\epsilon}{4 \vert x_0} * 3 \vert x_0 \vert$$ $$< \epsilon$$.

Alternatively, take $$\delta = \min\{1, \frac{\epsilon}{1 + 2\vert x_0 \vert} \}$$. We get $$\vert x - x_0 \vert < \delta \leq 1$$, and $$\vert x + x_0 \vert \leq \vert x - x_0 \vert + 2 \vert x_0 \vert < 1 + 2 \vert x_0 \vert$$. This gives us $$\vert x - x_0 \vert \vert x + x_0 \vert < \delta * (1 + 2\vert x_0 \vert)\leq \epsilon$$.

### Remark

$$\delta > 0$$ typically depends on both $$\epsilon > 0$$ and $$x_0 \in X$$.

## Continuity For General Spaces

Theorem: $$f: (X, d_x) \rightarrow (Y, d_y)$$ is continuous if and only if $$\forall U \subset Y$$ open, $$f^{-1} (U) \subset X$$ is open. Remark. $$f^{-1}$$ is not a function; it is defined as $$f^{-1} := {x \in X \vert f(x) \in U}$$.

Proof:

(→) $$f$$ continuous, $$U \subset Y$$ open. We want to show that $$f^{-1}(U) \subset X$$ is open, ie. $$\forall x \in f^{-1}(U), \exists r > 0$$ such that $$B_r(x) \subset f^{-1}(U)$$.
Since $$U$$ is open, $$\exists \epsilon > 0$$ such that $$B_\epsilon(y) \subset U$$.
Since $$f$$ is continuous, we can find a $$\delta$$ such that if $$z \in B_\delta(x)$$, then $$f(z) \in B_\epsilon(y)$$, which implies that $$z \in f^{-1}(U)$$, and therefore $$B_\delta(x) \subset f^{-1}(U)$$.

(←) Given that $$\forall U \subset Y$$ open, $$f^{-1} (U) \subset X$$ is open, $$\forall x_0 \in X, \forall \epsilon > 0$$, we want to show that $$\exists \delta > 0$$ such that $$d(x, x_0) < \delta \implies d(f(x), f(x_0)) < \epsilon$$.
$$B_{\epsilon}(f(x_0)) \subset Y$$ is open. By our premise, $$f^{-1}(B_{\epsilon}(f(x_0))) \subset X$$ is open.
Therefore, $$\exists \delta > 0$$ such that $$B_\delta(x_0) \subset f^{-1} (B_\epsilon (f(x_0)))$$, hence if $$d(x, x_0)< \delta$$, then $$d(f(x), f(x_0)) < \epsilon$$.