Equivalence of Definitions of Continuity on Metric Spaces

Theorem
Let $M_1 = \left({A_1, d_1}\right)$ and $M_2 = \left({A_2, d_2}\right)$ be metric spaces.

Let $f: A_1 \to A_2$ be a mapping from $A_1$ to $A_2$.

Definition by Points implies Definition by Open Sets
Suppose that $f$ is continuous at every point $x \in A_1$.

Let $U \subseteq M_2$ be open in $M_2$.

Let $x \in f^{-1} \left({U}\right)$.

Since $U$ is open in $M_2$:
 * $\exists \epsilon \in \R_{>0}: B_\epsilon \left({f \left({x}\right); d_2}\right) \subseteq U$

where $B_\epsilon \left({f \left({x}\right); d_2}\right)$ denotes the open $\epsilon$-ball of $f \left({x}\right)$ in $M_2$.

By the definition of continuity at a point:
 * $\exists \delta \in \R_{>0}: f \left({B_\delta \left({x}\right); d_1}\right) \subseteq B_\epsilon \left({f \left({x}\right); d_2}\right)$

So:
 * $f \left({B_\delta \left({x}\right)}\right) \subseteq U$

and so:
 * $B_\delta \left({x}\right) \subseteq f^{-1} \left({U}\right)$

Thus $f^{-1} \left({U}\right)$ is open in $M_1$.

Definition by Open Sets implies Definition by Points
Suppose $f$ is defined to be continuous in the sense that:
 * for every $U \subseteq A_2$ which is open in $M_2$, $f^{-1} \left({U}\right)$ is open in $M_1$.

Let $x \in A_1$.

Then by Open Ball of Point Inside Open Ball:
 * $\exists \epsilon \in \R_{>0}: B_\epsilon \left({f \left({x}\right); d_2}\right)$ is open in $M_2$

So by hypothesis, $f^{-1} \left({B_\epsilon \left({f \left({x}\right); d_2}\right)}\right)$ is open in $M_1$.

As $f \left({x}\right) \in B_\epsilon \left({f \left({x}\right); d_2}\right)$, it follows that:
 * $x \in f^{-1} \left({B_\epsilon \left({f \left({x}\right); d_2}\right)}\right)$

So by hypothesis:
 * $\exists \delta \in \R_{>0}: B_\delta \left({x; d_1}\right) \subseteq f^{-1} \left({B_\epsilon \left({f \left({x}\right); d_2}\right)}\right)$

Then:
 * $f \left({B_\delta \left({x}\right)}\right) \subseteq B_\epsilon \left({f \left({x}\right)}\right)$

Thus by the $\epsilon$-Ball definition, $f$ is continuous at $x$.