Continuity at a point in terms of closure If $X$ and $Y$ are topological spaces, for $f:X\to Y$ to be continuous at $x_0\in X$ it is necessary that $A\subseteq X \land x_0\in\overline{A} \implies f(x_0)\in\overline{f(A)}$.
I was wondering whether it is also sufficient. A proof or counterexample would be much appreciated!
Proof (necessity): Let $V$ be a neighborhood of $f(x_0)$. Since $f$ is continuous, $f^{-1}(V)$ is a neighborhood of $x_0$ in $X$. Since $x_0\in\overline{A}$, we have $A\cap f^{-1}(V)\neq\varnothing$. Let $x\in A\cap f^{-1}(V)$. Then $f(x)\in f(A)\cap V$, so that $f(A)\cap V\neq\varnothing$; since this holds for any neighborhood $V$ of $f(x_0)$, we have $f(x_0)\in\overline{f(A)}$.
 A: Let $V\subset Y$ be an open such that $f(x_0)\in V$. If $x_0 \in \overline{f^{-1}(Y\setminus V)}$, then $f(x_o)\in \overline{f(f^{-1}(Y\setminus V))}\subset \overline{Y\setminus V}= Y\setminus V$, a contradiction, so $x_0 \not\in \overline{f^{-1}(Y\setminus V)}$. Then, if $U = X\setminus \overline{f^{-1}(Y\setminus V)}$  is an open in $X$ such that $x_0\in U$, and $f(U)\subset V$, so $f$ is continuous in $x_0$.
A: It's also sufficient: let $y=f(x_0)$ and $y \in V$, $V$ open in $Y$.
We want to find (for continuity at $x_0$) find some open neighbourhood $U$ of $x_0$ such that $f[U] \subseteq V$.
Suppose that this would fail, then for every neighbourhood $U$ of $x_0$ we would have $f[U] \nsubseteq V$, or equivalently $U \cap f^{-1}[Y\setminus V] \neq \emptyset$.
It follows that then $x_0 \in \overline{f^{-1}[Y\setminus V]}$ and so the assumption on $f$ would imply that $y=f(x_0) \in \overline{f[f^{-1}[Y\setminus V]]}$. But $f[f^{-1}[B]] \subseteq B$ for any $B$ so we'd deduce that $y \in \overline{Y\setminus V} = Y\setminus V$ which is nonsense. So contradiction and such a $U$ must exist.
