[proofplan]
We prove the equivalence directly from the definition of the metric topology. If $f$ is continuous at $x_0$, then the inverse image of every neighbourhood of $f(x_0)$ is a neighbourhood of $x_0$; applying this to the metric ball $B_Y(f(x_0),\varepsilon)$ gives the desired $\delta$. Conversely, the epsilon-delta condition says exactly that every metric ball around $f(x_0)$ pulls back to a set containing a metric ball around $x_0$, which is the neighbourhood condition for continuity at $x_0$.
[/proofplan]
[step:Derive the epsilon-delta condition from topological continuity at $x_0$]
Assume that $f$ is continuous at $x_0$ with respect to $\tau_X$ and $\tau_Y$. Let $\varepsilon > 0$ be arbitrary, and define the metric ball
\begin{align*}
B_Y(f(x_0),\varepsilon) := \{y \in Y : d_Y(y,f(x_0)) < \varepsilon\}.
\end{align*}
Since $B_Y(f(x_0),\varepsilon)$ is open in the metric topology $\tau_Y$ and contains $f(x_0)$, continuity of $f$ at $x_0$ implies that there exists an [open set](/page/Open%20Set) $U \in \tau_X$ such that
\begin{align*}
x_0 \in U \subset f^{-1}(B_Y(f(x_0),\varepsilon)).
\end{align*}
Because $U$ is open in the metric topology $\tau_X$ and contains $x_0$, there exists $\delta > 0$ such that the metric ball
\begin{align*}
B_X(x_0,\delta) := \{x \in X : d_X(x,x_0) < \delta\}
\end{align*}
satisfies $B_X(x_0,\delta) \subset U$. Therefore, for every $x \in X$, if $d_X(x,x_0)<\delta$, then $x \in B_X(x_0,\delta) \subset U \subset f^{-1}(B_Y(f(x_0),\varepsilon))$, and hence $f(x) \in B_Y(f(x_0),\varepsilon)$. By the definition of $B_Y(f(x_0),\varepsilon)$, this means
\begin{align*}
d_Y(f(x),f(x_0)) < \varepsilon.
\end{align*}
Since $\varepsilon > 0$ was arbitrary, the epsilon-delta condition follows.
[guided]
Assume that $f$ is continuous at $x_0$ in the topological sense. We must prove a metric statement: given an arbitrary tolerance $\varepsilon > 0$ in $Y$, we must find a tolerance $\delta > 0$ in $X$ that forces $f(x)$ to remain within $\varepsilon$ of $f(x_0)$.
Fix $\varepsilon > 0$. Define the open metric ball in $Y$ centred at $f(x_0)$ by
\begin{align*}
B_Y(f(x_0),\varepsilon) := \{y \in Y : d_Y(y,f(x_0)) < \varepsilon\}.
\end{align*}
By definition of the metric topology $\tau_Y$, this ball is open in $Y$. It also contains $f(x_0)$, since $d_Y(f(x_0),f(x_0))=0<\varepsilon$.
Continuity of $f$ at $x_0$ means that every open neighbourhood of $f(x_0)$ pulls back to a neighbourhood of $x_0$. Applying this to $B_Y(f(x_0),\varepsilon)$ gives an open set $U \in \tau_X$ such that
\begin{align*}
x_0 \in U \subset f^{-1}(B_Y(f(x_0),\varepsilon)).
\end{align*}
Now we use the fact that $\tau_X$ is the metric topology induced by $d_X$. Since $U$ is open in $\tau_X$ and contains $x_0$, there exists $\delta > 0$ such that
\begin{align*}
B_X(x_0,\delta) := \{x \in X : d_X(x,x_0) < \delta\}
\end{align*}
is contained in $U$.
Let $x \in X$ satisfy $d_X(x,x_0)<\delta$. Then $x \in B_X(x_0,\delta)$, hence $x \in U$, and therefore
\begin{align*}
x \in f^{-1}(B_Y(f(x_0),\varepsilon)).
\end{align*}
By definition of preimage, this says $f(x) \in B_Y(f(x_0),\varepsilon)$. By definition of the ball in $Y$, this is exactly
\begin{align*}
d_Y(f(x),f(x_0)) < \varepsilon.
\end{align*}
Thus the required $\delta$ exists for the chosen $\varepsilon$, and since $\varepsilon > 0$ was arbitrary, the epsilon-delta condition holds.
[/guided]
[/step]
[step:Use the epsilon-delta condition to prove topological continuity at $x_0$]
Assume that for every $\varepsilon > 0$ there exists $\delta > 0$ such that, for every $x \in X$,
\begin{align*}
d_X(x,x_0)<\delta \implies d_Y(f(x),f(x_0))<\varepsilon.
\end{align*}
Let $V \in \tau_Y$ be an open set with $f(x_0) \in V$. Since $\tau_Y$ is the metric topology induced by $d_Y$, there exists $\varepsilon > 0$ such that
\begin{align*}
B_Y(f(x_0),\varepsilon) := \{y \in Y : d_Y(y,f(x_0)) < \varepsilon\}
\end{align*}
satisfies $B_Y(f(x_0),\varepsilon) \subset V$.
By the epsilon-delta hypothesis, choose $\delta > 0$ such that, for every $x \in X$,
\begin{align*}
d_X(x,x_0)<\delta \implies d_Y(f(x),f(x_0))<\varepsilon.
\end{align*}
Define
\begin{align*}
B_X(x_0,\delta) := \{x \in X : d_X(x,x_0) < \delta\}.
\end{align*}
For every $x \in B_X(x_0,\delta)$, the displayed implication gives $f(x) \in B_Y(f(x_0),\varepsilon) \subset V$. Hence
\begin{align*}
B_X(x_0,\delta) \subset f^{-1}(V).
\end{align*}
Since $B_X(x_0,\delta)$ is open in $\tau_X$ and contains $x_0$, the set $f^{-1}(V)$ is a neighbourhood of $x_0$. Therefore every open neighbourhood $V$ of $f(x_0)$ has inverse image a neighbourhood of $x_0$, so $f$ is continuous at $x_0$.
[guided]
Assume the epsilon-delta condition. We must prove continuity at $x_0$ in the topological sense. That means: whenever $V$ is an open subset of $Y$ containing $f(x_0)$, the preimage $f^{-1}(V)$ must be a neighbourhood of $x_0$ in $X$.
Let $V \in \tau_Y$ be open and suppose $f(x_0) \in V$. Because $\tau_Y$ is the metric topology induced by $d_Y$, openness of $V$ at the point $f(x_0)$ gives a radius $\varepsilon > 0$ such that the metric ball
\begin{align*}
B_Y(f(x_0),\varepsilon) := \{y \in Y : d_Y(y,f(x_0)) < \varepsilon\}
\end{align*}
is contained in $V$.
Now apply the epsilon-delta hypothesis to this particular $\varepsilon$. There exists $\delta > 0$ such that, for every $x \in X$,
\begin{align*}
d_X(x,x_0)<\delta \implies d_Y(f(x),f(x_0))<\varepsilon.
\end{align*}
Define the corresponding metric ball in $X$ by
\begin{align*}
B_X(x_0,\delta) := \{x \in X : d_X(x,x_0) < \delta\}.
\end{align*}
Take any $x \in B_X(x_0,\delta)$. Then $d_X(x,x_0)<\delta$, so the implication gives
\begin{align*}
d_Y(f(x),f(x_0))<\varepsilon.
\end{align*}
Equivalently, $f(x) \in B_Y(f(x_0),\varepsilon)$. Since this ball is contained in $V$, we have $f(x) \in V$, which means $x \in f^{-1}(V)$.
Thus every point of $B_X(x_0,\delta)$ lies in $f^{-1}(V)$, so
\begin{align*}
B_X(x_0,\delta) \subset f^{-1}(V).
\end{align*}
The ball $B_X(x_0,\delta)$ is open in the metric topology $\tau_X$ and contains $x_0$. Therefore $f^{-1}(V)$ contains an open neighbourhood of $x_0$, so it is itself a neighbourhood of $x_0$. Since this holds for every open set $V \in \tau_Y$ containing $f(x_0)$, $f$ is continuous at $x_0$.
[/guided]
[/step]
[step:Combine both implications]
The first step proves that topological continuity at $x_0$ implies the epsilon-delta condition. The second step proves that the epsilon-delta condition implies topological continuity at $x_0$. Therefore $f$ is continuous at $x_0$ if and only if for every $\varepsilon>0$ there exists $\delta>0$ such that, for every $x \in X$,
\begin{align*}
d_X(x,x_0)<\delta \implies d_Y(f(x),f(x_0))<\varepsilon.
\end{align*}
This proves the theorem.
[/step]