I have been given this definition of a continuous function between two topological spaces. The definition states the following:
Let $f:X \to Y$ be a map between topological spaces $(X,\mathcal{T}_X)$ and $(Y,\mathcal{T}_Y)$. We say that $f$ is continuous if $\forall U\in\mathcal{T}_Y \implies f^{-1}(U)\in\mathcal{T}_X$.
I was reading my notes and there is a proposition which doesn't have a proof in the notes and remarks that it is easy to prove. So I wanted to check whether I could prove it. The proposition is as follows:
$\textbf{Proposition}$: A map $f: X \to Y$ between topological spaces is continuous if and only if $f^{-1}(V)$ is closed in $X$ whenever $V$ is closed in $Y$.
Now I interpreted this proposition as such:
For a map $f:X \to Y$ and $V$ closed in $Y$, $f$ is continuous if and only if $f^{-1}(V)$ is closed in $X$.
I attempted to prove this and came up with something but I'm not sure whether its correct. The proof is as follows:
$\Rightarrow$ Suppose $f$ is continuous and since $V$ is closed then $Y \backslash V$ is open in $Y$ (by def of $V$ closed in $Y$). Now since $f$ is continuous therefore by the definition of continuous $f$, we have that $f^{-1}(Y\backslash V) = X \backslash f^{-1}(V)$ is open in $X$. So $f^{-1}(V)$ is closed in $X$.
$\Leftarrow$ Suppose $f^{-1}(V)$ is closed in $X$ then $X\backslash f^{-1}(V) = f^{-1}(Y\backslash V)$ is open in $X$. As $Y\backslash V$ is open in $Y$ and $f^{-1}(Y\backslash V)$ is open in $X$ therefore $f$ is continuous. $\square$
Now my questions is whether this proof that I have presented is correct?
If it is not correct, where did I go wrong?
When I look at my proof, I doubt about the correctness of my last statement in the converse part of the proof. The definition of continuous function says, f is continuous if $\forall U \in \mathcal{T}_Y \implies f^{-1}(U) \in \mathcal{T}_X$. But that doesn't mean is if $ f^{-1}(U)\in\mathcal{T}_X$ and $U\in \mathcal{T}_Y$ then $f$ is continuous i.e. if $f^{-1}(U)$ is open in $X$ and $U$ is open in $Y$ then $f$ is continuous, right? Or have I completely misunderstood the definition?
You say
This suggests that continuity depends only on the inverse image of this set, which is nonsense; the quantifiers are wrong, one could say, it should say (as in your first statement on open sets)
$$f \text { is continuous } \iff \forall C \subseteq Y \text{ closed }: f^{-1}[C] \text{ closed in } X$$
and the proof is as you sketched, using that complements and $f^{-1}$ combine well.
(so if $f$ is continuous and $C \subseteq Y$ is closed, $Y\setminus C \in \mathcal{T}_Y$ so continuity gives $f^{-1}[Y \setminus C] \in \mathcal{T}_X$ and as $ f^{-1}[Y \setminus C] = X\setminus f^{-1}[C]$, we have that $f^{-1}[C]$ is closed in $X$ as its complement is open. Going from this property to continuity is similar again).
So your proof was essentially correct, in short.