# Prove that if a continuous function is injective, then it is monotonic

It is intuitive and it seems very obvious that if a function $f : X \rightarrow Y$ is continuous on whole $X$ and it's injective, then it must be monotonic, but I can't come up with any neat proof for that. Could you maybe help me?

-
What are $X$ and $Y$? Parts of $\mathbb{R}$? –  Seirios Jan 15 '13 at 18:22
Depends on what kind of topological spaces $X$ and $Y$ are. To speak of monotonic, they should be ordered. Maybe you even want just subsets of $\mathbb R$? Then $X=(-3,-2)\cup(0,1)$, $Y=\mathbb R$, $f(x)=x^3-9x$ is a counterexample. –  Hagen von Eitzen Jan 15 '13 at 18:25
show that there exist a continuous map$f^{-1}:Y \to X$, $f(a) \neq f(b) \implies a \neq b \implies a < b$ or $b < a$, Let $a = f^{-1} (A)$ and $b = f^{-1} (B)$. $a < b \implies f^{-1}(A) < f^{-1}(B) \implies A < B \implies f(a) < f(b)$ hence monotonic. –  Santosh Linkha Jan 15 '13 at 18:42
I'm so sorry. I only need X, Y to be connected subsets of R. because I proved that inverse of a continuous and injective function $f:(a, b) \rightarrow R$ is also continuous and I think I should include that proof there. –  Hagrid Jan 15 '13 at 18:52
@HagenvonEitzen: I learned a function is monotonic if the preimage of a connected set is connected, so I don't think you need ordering at all, and under this definition, you would have to include either $-3$ or $0$ in your example so that the image is connected. Then any open interval around $0$ would be disconnected, showing the function isn't monotone. –  Clayton Jan 15 '13 at 19:02

I assumed that $X$ and $Y$ are parts of $\mathbb{R}$.
If $X$ is not connected, Hagen von Eitzen gave a counterexample; otherwise, you can use the intermediate value theorem to prove the statement.
@Hagrid: If $f$ is not monotonic, there exists $x<y,z<t \in X$ such that $f(x) \geq f(y)$ and $f(z) \leq f(t)$. You should make a drawing. –  Seirios Jan 15 '13 at 19:07
Ok, it's all clear now. We need to apply the fact that if $f'(x)<0$, then $f$ is decreasing and if $f'(x)>0$, then $f$ is increasing. Is that ok? –  Hagrid Jan 15 '13 at 19:24
@Hagrid: $f$ is not supposed to be differentiable and it is not necessary. You only have to distinguish the possible cases; for example, if $y<z$ and $f(y) \geq f(z)$, then you can apply the intermediate value theorem to find $a \in [y,z[$ and $b \in [z,t]$ such that $f(a)=f(b)$, ant that it is impossible because $f$ is injective. –  Seirios Jan 15 '13 at 21:40