Continuous injective function that fails to map open sets to open sets I'm studying metric spaces and have just proved that continuous maps preserve open sets under pre-image. The book I'm learning from says to beware of what this theorem does not say: that a continuous map sends the forward image of an open set to an open set.
I found these counterexamples:

*

*any constant map $f:\mathbb{R}\to \mathbb{R}$. Since singletons are closed in $\mathbb{R}$ under usual metric.

*$f:\mathbb{R}\to \mathbb{R}$; $f(x)=x^2$, since $f((-1,1))=[0,1)$ but $[0,1)$ is not open in $\mathbb{R}$.

Reflecting on these it seems that both fail to be injective. So I have been trying to find a continuous injective function that fails to map forward open sets to open sets but am at a loss. Any ideas?

Let $S^1=\{(x,y)\in\Bbb R^2\mid x^2+y^2=1\}$ and take$$\begin{array}{rccc}f\colon&[0,2\pi)&\longrightarrow&S^1\\&\theta&\mapsto&(\cos\theta,\sin\theta).\end{array}$$Then $f$ is bijective and continuous, but it maps the open subset $[0,\pi)$ of $[0,2\pi)$ onto $\{(x,y)\in S^1\mid y\geqslant0\}\setminus\{(-1,0)\}$, which is not an open subset of $S^1$.
