Prove that a function between metric spaces $(X,d_{X})$ and $(Y,d_{Y})$ is continuous iff the pre-image of open sets is open

continuitymetric-spacesproof-writingreal-analysis

Let $(X,d_{X})$ be a metric space, and let $(Y,d_{Y})$ be another metric space. Let $f:X\to Y$ be a function. Then the following two statements are logically equivalent:

(a) $f$ is continuous.

(b) Whenever $V$ is an open set in $Y$, the set $f^{-1}(V) = \{x\in X: f(x)\in V\}$ is an open set in $X$.

I know this problem is pretty standard, but I am not able to prove any of the two directions.

Since I am studying real analysis at the moment (metric spaces, in fact), could someone provide a proof or at least a hint as how to prove it? It is not homework. Any comment or contributions are welcome.

Best Answer

Assume b)

Let $\epsilon\gt 0$ and $x\in X$. The ball $B(f(x),\epsilon)\subset Y$ is an open subset. Its reciprocal image $f^{-1}\left(B(f(x),\epsilon\right)$ is open. But $x\in f^{-1}\left(B(f(x),\epsilon\right)$ so there is an open ball centred at $x$ included in this open subset. This means there is a $\delta\gt 0$ such that $B(x,\delta)\subset f^{-1}\left(B(f(x),\epsilon\right)$. We have just proved that

$$\forall x\in X\,\forall \epsilon\gt 0\,\exists \delta\gt 0,\,d_X(x,y)\leq \delta\Rightarrow d_Y(f(x),f(y)\leq \epsilon$$

For the other implication assume a) $f$ continuous

Consider $V\subset Y$ an open subset. Let $x\in f^{-1}(V)$; this means $f(x)\in V$. Take $\epsilon \gt 0$ such that $B(f(x),\epsilon)\in V$. Because of the assumption there exists $\delta\gt 0$ such that

$$y\in B(x,\delta)\Rightarrow f(y)\in B(f(x),\epsilon)$$

This means

$$B(x,\delta)\subset f^{-1}\left(B(f(x),\epsilon\right)\subset f^{-1}(V)$$

And we have juste proved that $f^{-1}(V)$ is open