I am studying an article in here. This article introduced the following definition.
Definition. Let $X$ and $Y$ be topological spaces. A function $f:X\to Y$ is said to be semi-totally continuous if for every semi-open set $V$ in $Y$ (i.e, $V\subset \overline{int V})$, the set $f^{-1}(V)$ is both open and closed in $X$.
My question is all about on the proof of the following theorem.
Theorem. Let $X$ and $Y$ be topological spaces and let $f:X\to Y$. Then the following statements are equivalent:
($i$) $f:X\to Y$ is semi-totally continuous.
($ii$) For each $x\in X$ and each semi-open set $V$ in $Y$ with $f(x)\in V$, there exists a set $U$ in $X$ which is both open and closed such that $x\in U$ and $f(U)\subset V$.
The proof of $(i)\Rightarrow (ii)$ is easy. I got confused on how the author come up with the proof of $(ii)\Rightarrow (i)$.
Let $V$ be semi-open in $Y$. We will show that the set $f^{-1}(V)$ is both open and closed in $X$. Let $x\in f^{-1}(V)$. Then $f(x)\in V$. Using $(ii)$, there exists a set $G_x$ in $X$ which is both open and closed such that $x\in G_x$ and $f(G_x)\subset V$, which implies that $G_x\subset f^{-1}(V)$. From this, it follows that the set $f^{-1}(V)$ is open.
Question. How can we proceed to show that the set $f^{-1}(V)$ is closed?
It's not true. For instance, let $X=\mathbb{N}\cup\{\infty\}$ with the usual order topology, let $Y=\mathbb{N}\cup\{\infty\}$ with the topology that the only nontrivial open set is $\mathbb{N}$, and let $f$ be the identity map. Note that any subset of $Y$ with nonempty interior is open, so every semi-open subset of $Y$ is open. So $f$ satisfies (ii) (the only nontrivial case to check is that $f^{-1}(\mathbb{N})=\mathbb{N}$ is a union of clopen sets in $X$). But $f$ is not semi-totally continuous since $f^{-1}(\mathbb{N})=\mathbb{N}$ is not closed in $X$ even though $\mathbb{N}$ is semi-open.