Let $ (X,\tau) $ be a topology space, $ f : X \rightarrow Y $ a surjective function, $ A \subset Y $, and consider the topology in $ Y $: $\,$ $ \tau _{f} = \lbrace A \subset Y: f^{-1}(A) \in \tau \rbrace$. Show that: $ A $ is closed in $ Y $ if and only if $ f^{-1}(A) $ is closed in $ X.$
I got stuck with the converse: suppose that $ f^{-1}(A) $ is closed in $ X $. Then $ X-f^{-1} (A)$ is open in $ X $. That is, $ X-f^{-1} (A) \in \tau $. This implies that
$ X-f^{-1}(A) \stackrel{?}{=} f^{-1} (f(X)) - f^{-1}(A) = f^{-1}(f(X)-A) = f^{-1} (Y-A) \in \tau$.
Since $ Y-A \subset Y$ and $ f^{-1} (Y-A) \in \tau $, we conclude that $ Y-A \in \tau_{f} $ and therefore $ A $ is closed in $ Y $.
I know that $ \stackrel{?}{=} $ is not true, unless $f$ is injective. So I got stuck in that part.
The surjectivity of $f$ is not needed at all.
If $B$ is closed in $Y$ then $Y - B$ is open in $Y$. So by the definition of $\tau_Y$, we have that $f^{-1}[Y-B] = X-f^{-1}[B]$ is open in $X$. Hence $f^{-1}[B]$ is closed in $X$. All implications are reversible, so the reverse also holds.
The identity $f^{-1}[Y-B] = X-f^{-1}[B]$ holds for all $B$ by virtue of the definition of $f^{-1}[\cdot]$: $x \in f^{-1}[Y-B]$ iff $f(x) \in Y-B$ iff $f(x) \notin B$ iff $x \notin f^{-1}[B]$ iff $x \in X-f^{-1}[B]$.