Sequential continuity on metric spaces Please give me a hint for proving this statement:

Let $(X,d)$ and $(Y,d')$ be metric spaces, $f$ a function from $X$ to $Y$. If $f^{-1}(B) $ is closed in $X$ for all closed subset $B$ of $Y$, then $f$ is sequentially continuous. 

Note that $f$ is sequentially continuous if and only if for any sequence $(x_n)$, if $d(x_n,x) \to 0$ then $d'(f(x_n),f(x)) \to 0$.
 A: By the definition of sequential continuity, we want to show that if a sequence $\{x_n\}$ converges to $x$ in $X$, then $\{f(x_n)\}$ converges to $f(x)$ in $Y$.
Let $U$ be an open neighborhood of $f(x)$ in $Y$. Then $B:=Y\setminus U$ is closed in $Y$, and $f^{-1}(B)$ is closed in $X$ by assumption. The preimage of a complement is the complement of the preimage, so $f^{-1}(B) = f^{-1}(Y)\setminus f^{-1}(U)$. Since $f$ is defined on all $X$, $f^{-1}(Y) = X$. Since $f^{-1}(B)$ is closed, this means $f^{-1}(U)$ is open in $X$, and it contains $x$. Now it's simply a matter of applying the definitions to find an integer $N$ for which
$$n\geq N\implies x_n\in f^{-1}(U).$$
Hitting this with $f$, we'll see that this $n\geq N\implies f(x_n)\in U$. Our neighborhood about $f(x)$ was arbitrary, so this means $f(x_n)\to f(x)$. If you want to be really technical about it, you can replace the neighborhood with an open ball of a certain radius and rework the proof to suit your needs.
Also notice that much of the work was to show that the preimage of open sets in $Y$ are open in $X$. This is an alternate definition of continuity (and much more common than the "closed preimage" one you gave above). Using this definition from the start cuts down our work significantly.
