[Math] example of a continuous function that is closed but not open

general-topology

Give an example of a continuous function $f:\mathbb{R} \to \mathbb{R}$ that is closed but not open.

$ f(x)=x^2$ is continuous and not open but It's not closed. What is an example?
Thanks in advance.

Best Answer

Consider the constant function $f(x)\equiv 0$, which is clearly continuous. Then for any set $E\subset \mathbb R$, either $f(E)=\varnothing$ or $f(E)=\{0\}$, each of which is a closed set. Hence $f$ is closed.

To show that $f$ is not open, just observe that $\mathbb R$ is open but $f(\mathbb R)=\{0\}$ is not open.

Related Question