George F Simmons, Topology and Modern Analysis pg.79 Problem 4
Let $X$ and $Y$ be metric spaces. Show that an into mapping $f:X \rightarrow Y$ is continuous $\iff$ $f^{-1}\left(G\right)$ is closed in $X$ whenever $G$ is closed in $Y$.
I can prove the problem for open sets, and I have been trying hard for closed. However, seems like I am stuck somewhere missing something obvious. Please don't answer directly, just give a small hint if possible.
EDIT: I am using the definition that $f^{-1}\left(G\right)$ exists only when $f$ is onto and if it is not then $f^{−1}\left(G\right)$ is a loose term for $f^{-1}\left(H\right)$ where $H$ is the range of $f$ in $G$.