Let $I\subset \mathbb R$ be an open interval and $f:I\to \mathbb R$ be a differentiable function. I would like to prove the following equivalence:
$$f:I\to\mathbb R\ \text{a diffeomorphism over $f(I)$}\Leftrightarrow f'(x)\cdot f'(y)>0\ \text{for every $x,y\in I$}$$
I'm trying to prove it using the inverse function theorem.
$\Leftarrow$
Since $f'(x)\neq 0$, take an arbitrary $x_0\in I$, there is an open subset $U\in I$ with $x_0\in U$ such that $f_{\restriction U}:U\to f(U)$ is a diffeomorphism. I don't know how to prove the function $f$ is a diffeomorphism on the entire $I$.
$\Rightarrow$
I have no idea, I need some hints.