Continuity equivalence theorem

Theorem
Let $$X$$ and $$Y$$ be two non-empty topological spaces, and $$f:X\to Y$$ a function from $$X$$ to $$Y$$. Then the following are equivalent:
 * 1) $$f$$ is continous;
 * 2) For all subset $$A$$ of $$X$$ we have $$f(\overline A)\subseteq \overline {f(A)}$$;
 * 3) The inverse image of a closed set in $$Y$$ is closed in $$X$$;
 * 4) The inverse image of an open set in $$Y$$ is open in $$X$$.

Proof
$$1\Rightarrow 2$$
 * 1) The inclusion holds if $$A=\emptyset$$
 * 2) Let $$x_0\in X$$ be an adherent point for $$A$$
 * 3) $$\underset{V\in \mathcal V(f(x_0))}{\forall} \; \underset{U\in \mathcal V(x_0)}{\exists} \; \underset{x\in U}{\forall} \; f(x)\in V$$ (by continuity)
 * 4) $$\underset{U\in \mathcal V(x_0)}{\forall} \; \underset{y\in U}{\exists} \; y\in U\cap A$$ (by definition)
 * 5) $$\underset{V\in \mathcal V(f(x_0))}{\forall} \; \underset{U\in \mathcal V(x_0)}{\exists}\; \underset{y\in U}{\exists} \; f(y)\in f(A)$$ (by 3 and 4)
 * 6) $$f(x_0)$$ is an adherent point for $$f(A)$$ (by definition)

$$2\Rightarrow 3$$
 * 1) Let $$G$$ be a closed set in $$Y$$
 * 2) Define $$F=f^{-1}(G)$$
 * 3) $$f(\overline F)\subseteq \overline{f(F)}=\overline G=G$$ (by hypothesis and definition)
 * 4) $$\overline F\subseteq f^{-1}(G)=F\subseteq \overline F$$ (by 2, 3, definition and definition)
 * 5) $$F=\overline F$$ and therefore is closed (by 4)

$$3\Rightarrow 4$$
 * 1) Let $$V$$ be open in $$Y$$ and $$U=f^{-1}(V)$$
 * 2) $$U^c=(f^{-1}(V))^c=f^{-1}(V^c)$$ (by definition of inverse image and complement)
 * 3) $$V^c$$ is closed (by definition)
 * 4) $$f^{-1}(V^c)$$ is closed (by hypothesis)
 * 5) $$U$$ is open (by definition)

$$4\Rightarrow 1$$
 * 1) Let $$x\in X$$, and $$V$$ be a neighbourhood of $$f(x)$$
 * 2) $$U=f^{-1}(V)$$ is open in $$X$$ (by hypothesis)
 * 3) $$U$$ is a neighbourhood of $$x$$ (by definition and definition)
 * 4) $$\underset{y\in U}{\forall} \; f(y)\in V$$ (by definition)
 * 5) $$f$$ is continuous (by definition)

Notations used

 * $$\mathcal V(x_0)$$: the set of neighbourhoods of $$x_0$$
 * $$f^{-1}(G)$$: the inverse image of $$G$$ by $$f$$
 * $$\overline F$$: the closure of $$F$$
 * $$U^c$$: the complement of $$U$$