# Continuous function between a topological and a metric space

Let $X$ a topological space and $(Y, d)$ a metric space. Let $f: X \rightarrow Y$ a function. Then, $f$ is continuous iff $\forall \, x \in X \, \, \, \forall \, \epsilon >0 \, \, \, \exists \, U \subset X$ open neighborhood of $x$ such that $d(f(x), f(y)) < \epsilon \, \, \forall \, y \in U$.

I know how to prove a similar statement for a map between metric spaces (using as definition that if $f$ is continuous, then $f^{-1}(U)$ is open for all $U \subset Y$ open set), but it didn't worked in this case.

• A metric space has a basis of open balls. A function is continuous iff the pre-image of a basis element is an open set. This last is easily proven: look up basis and open ball. – Tom Collinge Mar 2 '18 at 14:08
• I tried to use your hint. If $\mathbb{B}$ is basis of Y (so the set of all open balls in $Y$) and $B_\alpha \in \mathbb{B}, \alpha \in J$, then we have by definition that $U\subset Y$ open iff $\exists \, B_\alpha \in \mathbb{B}, \alpha \in J$, such that $U = \cup_{\alpha \in J} B_\alpha$. So $f$ is continuous iff $f^{-1}(U)= f^{-1}(\cup_{\alpha \in J} B_\alpha) = \cup_{\alpha \in J} \, f^{-1}(B_\alpha)$ is open. But how can I say that $f^{-1}(B_\alpha)$ is open? – userr777 Mar 2 '18 at 18:42
• Sorry wrong question, I meant how can I connect this fact with the existence of the neighborhood $U$ such that $f(U) \in B_{\epsilon}(f(x))$? – userr777 Mar 2 '18 at 20:40
• There a quite a few conditions that are equivalent to continuity of $f:X\to Y,$ for any spaces $X,Y,$ including this one, if you replace the set open $d$-balls centered $f(x)$ with the set of either (i) every open $V \subset Y$ such that $f(x)\in V,$ or (ii) every $W$ such that $f(x)\in W\in \Bbb B,$ where $\Bbb B$ is a base (basis) for $Y$ ...Some problems & constructions seem to be more suited to one condition than to another. – DanielWainfleet Mar 3 '18 at 15:00

From the condition to continuity of $f$: let $O$ be open in $Y$. We want to show that $f^{-1}[O]$ is open in $X$. So let $X \in f^{-1}[O]$, so we know that $y:=f(x) \in O$. As $O$ is open in the metric space $(Y,d)$ we have some $\varepsilon>0$ such that $$B(y, \varepsilon) \subseteq O$$
Applying the condition to $x,\varepsilon$ we get some open neighbourhood $U$ of $x$ such that for all $p \in U$ we have $d(y, f(p)) < \varepsilon)$. This means that for all $p \in U$, $f(p) \in B(y,\varepsilon)$ and so for all $p \in U$, $f(p) \in O$ and so $$\forall p \in U: p \in f^{-1}[O]$$
and this shows that $U \subseteq f^{-1}[O]$ and so $x$ is an interior point of $f^{-1}[O]$. As $x$ was arbitary, $f^{-1}[O]$ is open in $X$.
From continuity to the condition is similar and even simpler: given $x$ and $\varepsilon >0$ the set $O= B(f(x), \varepsilon)$ is open in $Y$ so $x \in f^{-1}[O]$ and the latter set is open (as $f$ is continuous), call it $U$ and check it obeys what we want: all points $y$ in $U$ map to $O$ which is the open ball so $d(f(y), f(x)) < \varepsilon$.