# Continuity definitions for topological spaces

I'm trying to prove that, for topological spaces $X,Y$ and $f:X\to Y$, the statement

$$"f(\text{cl}\, A)\subseteq \text{cl}\, f(A),\;\forall A\subseteq X"$$ Implies $"B$ closed in $Y\Rightarrow f^{-1}(B)$ closed in $X"$ ($\text{cl}=$ closure). This is my attempt:

Let $U\subseteq Y$ be closed. Then: $$f\big(\color{blue}{\text{cl}\,f^{-1}(U)}\big)\subseteq \text{cl}\,f\big(f^{-1}(U)\big)=\text{cl}\,U=U=f\big(\color{blue}{f^{-1}(U)}\big)$$

So $\text{cl}\, f^{-1}(U)\subseteq f^{-1}(U)\Rightarrow f^{-1}(U)$ is closed in $X$.

Is my proof correct? I am a little weary of using $f$ and $f^{-1}$ as I have.

The equality $\text{cl} f(f^{-1}(U)) = \text{cl}(U)$ and the subsequent one are not correct because $f(f^{-1}(U)) \neq U$ in general.
However, it holds that $f(f^{-1}(U) \subset U$, so you can argue as follows:
$$\color{blue}{f(\text{cl}(f^{-1}(U)))} \subset \text{cl}f(f^{-1}(U)) \subset \text{cl} (U )= \color{blue}{U}$$
$$\text{cl}(f^{-1}(U)) \subset f^{-1}(U)$$
(Using $f(A) \subset B \implies A \subset f^{-1}(B)$)