Prove that a function between metric spaces is continuous iff the inverse image of a closed set is closed Here is the question:

Prove that the function $f: E \rightarrow E'$ between metric spaces is continuous iff whenever $ C\subset E'$ is closed, $f^{-1}(C)$ is a closed subset of $E$.

What I was thinking of doing is this following:
First, assume F is continuous. So we want to show that whenever  $ C\subset E'$ is closed, then $f^<(C)$ is a closed subset of $E$. To do this, do we just need to show that whenever $C^c \subset E'$ is open, then $f^<(C^c)$ is open? 
 A: Suppose $f:E\to E'$ is continuous, then if $N\subset E'$ is open, we know that $f^{-1}(N)\subset E$ must also be open. This is the open set condition for continuity. In the case of my course this was the definition of continuity. So, we basically want to show equivalence of the open and closed set conditions.
Suppose $f$ is continuous. Suppose some $C\subset E'$ is closed. Then, we know that $C^C$ is necessarily open. This implies that $f^{-1}(C^C)$ is also open. So, $(f^{-1}(C^C))^C$ must be closed, $(f^{-1}(C^C))^C=f^{-1}(C)$. Thus, $C$ closed implies $f^{-1}(C)$ closed for all continuous $f$.
Can you prove the converse of the statement?
A: The argument is essentially that for any subset $A \subseteq Y$, $X \setminus f^{-1}[A] = f^{-1}[Y \setminus A]$, so 
$$\forall A \subseteq Y: f^{-1}[A] = X \setminus f^{-1}[Y \setminus A]\text{.}$$
This one can easily check the definitions (check two inclusions); it's purely elementary set theory. 
Assume $f$ is open w.r.t inverses of open sets. 
Then when $A$ is closed, $Y \setminus A$ is open, its inverse image is open by assumption, and then its complement is closed. So $f^{-1}[A]$ is closed.
Assume $f$ is closed w.r.t inverses of closed sets. The similar argument to above, interchanging open and closed, we see that $f^{-1}[A]$ is open for $A$ open.
Hence the equivalence.  
