Openness of the set of injective functions in $C(\mathbb{R})$? 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?
 A: 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).
A: A simpler example is $f_\epsilon(x)=x^3+\epsilon x$ which is injective iff $\epsilon\geq 0$.
A: I think that this is a kind of question (which is not research level and) which should not be answered by a counterexample but by an explanation: What would it mean that, e.g., the identity map is an interior point of the set of injective continuous functions? There should be a compact interval $[-n,n]$ and $\varepsilon>0$ such that any function $f\in C(\mathbb R)$ with $|f(x)-x|<\varepsilon$ for $x\in [-n,n]$ is injective. This is absurd because you have no condition at all outside $[-n,n]$.  But also inside the interval one can easily modify the graph of the identity to get a non-injective function which $\varepsilon$-close to the identity.
