Proof of equivalent definitions of continuity of a function Let $X$ and $Y$ be metric spaces, and $f : X\rightarrow Y$ a function
I have to prove:
(1) $f : X\rightarrow Y$ is continuous
(3) $\forall\,F \subset Y closed: f^{-1}(F) \, is\,closed$
from $(3) \Rightarrow (1)$ 
I know, for a continuous function:
$\forall \, A \subset X: f(\overline A)\subset \overline{f(A)}$
I can proove it by proving the contraposition:
$(\exists\,F \subset Y$ closed: $f^{-1}(F)$ is open$)$  $\Rightarrow $($f : X\rightarrow Y$ is continuous$)$
But I can't seem to get any further in the proof, since I have no experience with prooving equivalent definitions like that :/
Can anyone help please?
 A: Firstly notice that your condition 3 is equivalent to the following:
(*) For every open $U\subseteq Y$, $f^{-1}(U)$ is open.
Proof: $U\subseteq Y$ is open iff $U^c$ is closed, also notice that $f^{-1}(U)^c=f^{-1}(U^c)$ hence $f^{-1}(U)$ is open iff $f^{-1}(U^c)$ is closed.
So now it suffices to show that $(1) \Leftrightarrow (*)$.
$(1)\Rightarrow (*)$
If $f$ is continuous let $U\subseteq Y$ be open, if $U$ is empty it's preimage is empty and hence open. So we assume that $U, f^{-1}(U)$ are non-empty. Let $x\in f^{-1}(U)$, as $f$ is continuous, for every $\epsilon>0$ there exists a $\delta>0$ such that $d_X(x,x')<\delta$ implies $d_Y(f(x),f(x'))<\epsilon$.
So pick $\epsilon>0$ such that $B(f(x),\epsilon)\subseteq U$, (we can do this as $U$ is open), then there is a $\delta>0$ such that for all $x'$ such that $d_X(x,x')<\delta$, $d_Y(f(x),f(x'))<\epsilon$. But then $f(B(x,\delta))\subseteq B(f(x),\epsilon)\subseteq U$, therefore $B(x,\delta)\subseteq f^{-1}(U)$ and so the preimage is open.
($*$)$\Rightarrow$ (1)
Let $f$ be as in ($*$) and let $\epsilon>0$ and $x\in X$. Consider $B(f(x),\epsilon)\subseteq Y$, this is open, hence it's preimage is open, and it contains $x$. So let $\delta>0$ be such that $B(x,\delta)\subseteq f^{-1}(B(f(x),\epsilon))$, then for every $x'$ such that $d_X(x,x')<\delta$, $x'\in B(x,\delta)$ and hence is in the preimage of $B(f(x),\epsilon)$. Thus $f(x')$ is in $B(f(x),\epsilon)$ and so $d_Y(f(x),f(x'))<\epsilon$ as required.
