Let $C(\mathbb{R})$ be equipped with the topology of compact convergence (or equivalently the compact-open topology). Then, is the subset $\left\{f\in C(\mathbb{R}):
\text{$f$ injective} 
\right\}$ an open subset therein?



Openness of the set of injective functions in $C(\mathbb{R})$?
Based on Matthew's post here we go:


Let $f\_n(x)\triangleq \left|\frac{x}{n+1}\cos(\frac{x-1}{n})\right| + \left(1-\frac1{n+1}\right) x$ and $f(x)=x$ and $\sup\_{x \in [0,1] }\|f\_n(x)-f(x)\| \in \mathscr{O}(n^{-1})$.


This provides a counter example on $C((0,1))$ and then just use the homeomorphism:
$$
\begin{aligned}
C(0,1) &\rightarrow C(\mathbb{R})\\
f &\mapsto f \circ \frac{1}{1+ \exp(-x)},
\end{aligned}
$$
to get the conclusion. (Note, that is preserves the class of injective maps).


