Let $X$ and $Y$ be topological spaces and $f:X\to Y$. Prove that $f$ is continuous if and only if $\overline{f^{-1}(B)}\subset f^{-1}(\overline B),$ for each $B\subset Y$.
- $\rightarrow$
Let $B\subset Y$. Then
$B\subset \overline B$
$\implies f^{-1}(B)\subset f^{-1}(\overline B)$
$\implies\overline{ f^{-1}(B)}\subset\overline {f^{-1}(\overline B)}=f^{-1}(\overline B),$ by the continuity of $f$.
- $\leftarrow$
Let $\overline B\subset Y,$ we want to show that $f^{-1}(\overline B)$ is closed, i.e. $\overline{ f^{-1}(\overline B)}\subset f^{-1}(\overline B).$
$$f^{-1}(B) \subset\overline{f^{-1}(B)}\subset f^{-1}(\overline B) $$
I am stuck here, what can I do from here?
Note that it was just an arbitrary idea to show continuity using closed sets, but if there is an easier way to show continuity, please suggest it.
For the converse, assume that for every $B \subset Y$, we have $\overline{f^{-1}(B)} \subset f^{-1}(\overline{B})$. Now pick any $K$ closed in $Y$. To show $f^{-1}(K)$ is closed in $X$. This will show continuity of $f$. The relation $f^{-1}(K) \subset \overline{f^{-1}(K)}$ always holds. So we must show that $\overline{f^{-1}(K)} \subset f^{-1}(K)$. By our assumption, we have that $\overline{f^{-1}(K)} \subset f^{-1}(\overline{K}) = f^{-1}(K)$ (since $K$ is closed in $Y \Rightarrow \overline{K} = K$).