# Example of continuous mapping of open(closed) set to not open(closed) set

I want to find a continuous function: $f:\textbf{R}^n \rightarrow \textbf{R}^m$ s.t. for some open subset $A$, $f(A)$ is not open, and for some closed $B$, $f(B)$ is not closed.

I am able to find some mappings that satisfy one condition, e.g. $f(x)=exp(-x)$ maps closed $[0,\infty)$ to not closed $(0,1]$, but cannot find an example which satisfies both conditions.

Consider the continuous map $f(x)=e^{-|x|}$. Then $f(\Bbb R)=(0,1]$. Note that $\Bbb R$ is both open and closed, but it's image $(0,1]$ is neither open nor closed.

Consider the continuous map :

$$f:\mathbb{R}\to\mathbb{R},x\mapsto\cases{1\quad\mathrm{if}\,x\le0\cr\frac 1{x+1}\quad\mathrm{otherwise}}$$

and the subsets $A=(-\infty,0)$, $B=[0,+\infty)$.

Then :

• $A$ is open and $f(A)=\{1\}$ is not open

• $B$ is closed and $f(B)=(0,1]$ is not closed