# Continuous functions do not necessarily map closed sets to closed sets

I found this comment in my lecture notes, and it struck me because up until now I simply assumed that continuous functions map closed sets to closed sets.

What are some insightful examples of continuous functions that map closed sets to non-closed sets?

The graph $$GG$$ of $$y=1/xy=1/x$$ is closed in $$\Bbb R^2\Bbb R^2$$, and the map $$p:\Bbb R^2\to\Bbb R:\langle x,y\rangle\mapsto xp:\Bbb R^2\to\Bbb R:\langle x,y\rangle\mapsto x$$ is continuous, but $$p[G]=(\leftarrow,0)\cup(0,\to)p[G]=(\leftarrow,0)\cup(0,\to)$$, which is not closed in $$\Bbb R\Bbb R$$.
The map $$\Bbb R\to\Bbb R:x\mapsto e^{-x}\Bbb R\to\Bbb R:x\mapsto e^{-x}$$ sends the closed subset $$[0,\to)[0,\to)$$ of $$\Bbb R\Bbb R$$ to the non-closed subset $$(0,1](0,1]$$. Other functions with horizontal asymptotes provide similar examples.
If $$XX$$ is any non-closed subset of a space $$YY$$, the inclusion map $$i:X\to Y:x\mapsto xi:X\to Y:x\mapsto x$$ gives a trivial example, since $$XX$$ is a closed subset of itself.
Another trivial example is obtained by taking any infinite set $$XX$$, letting $$\tau_d\tau_d$$ be the discrete topology on $$XX$$, and letting $$\tau\tau$$ be any other topology on $$XX$$. The identity map from $$\langle X,\tau_d\rangle\langle X,\tau_d\rangle$$ to $$\langle X,\tau\rangle\langle X,\tau\rangle$$ is automatically continuous. However, there is at least one $$x_0\in Xx_0\in X$$ such that $$\{x_0\}\notin\tau\{x_0\}\notin\tau$$ (i.e., $$x_0x_0$$ isn’t an isolated point of $$\langle X, \tau \rangle\langle X, \tau \rangle$$); if $$A=X\setminus\{x_0\}A=X\setminus\{x_0\}$$, then $$AA$$ is closed in $$\langle X,\tau_d\rangle\langle X,\tau_d\rangle$$ (as is every subset of $$XX$$), but $$AA$$ is not closed in $$\langle X,\tau\rangle\langle X,\tau\rangle$$.