Injective continuous real function that is not strictly monotone I'm trying to find an injective continuous real function that is not strictly monotone.
I can't seem to find an example for that. When it is continuous and not monotone it can't be injective, since the y values are not unique for every x and the other way around. I already proved, that it is not possible on an interval and somone proposed to me, that there might be a possibility if I use an union of intervals, but I can't find any.
Does anyone have an example or a hint to find one?
 A: You want a function that is continuous and injective. So you know it has to be strictly monotone on each interval of the domain, but you don't want it to be strictly monotone overall. You're pointed in the direction of having multiple disjoint intervals as domain. That analysis only leaves one option: Have something happen between the intervals.
For instance, you can have the function increase on each interval, but decrease between intervals. Or you can have the function increase on some intervals and decrease on others. None of this will automatically invalidate continuity or injectivity, although for constructing a concrete example you of course need to make certain that it still holds.
A: The function $f : \mathbb{R} \setminus \lbrace 0 \rbrace \rightarrow \mathbb{R}$ defined for every $x \neq 0$ by
$$f(x)=\frac{1}{x}$$
is continuous, injective, but not monotonic.
A: If your domain need not be an interval, you can just take $f(x) = x$ for $x\in (0,1)$ and then $f(x) = -x$ for $x\in (2,3)$. This is an injective function $f:(0,1)\cup (2,3)\to \mathbb{R}$ but is not monotone.
