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.
$\Leftarrow$: As commented by Arthur, $f'$ never changes sign on $I$. That is, there does not exist $x,y \in I$ with $f'(x)f'(y) < 0$. Moreover, this condition implies $f'(x) \neq 0$ for all $x \in I$, so $\mathrm Df$ is invertible on $I$. If you can also show that $f'$ is continuous, you can invoke the Inverse Function Theorem which asserts $f^{-1}:f[I] \to I$ is continuously differentiable, and hence $f$ is a $\mathrm C^1$-diffeomorphism.
$\Rightarrow:$ $f$ is a diffeomorphism implies $f' \neq 0$. Moreover, $f'$ is continuous (since $f$ is continuously differentiable), so $f'$ may never cross $0$. Hence $f'(x)f'(y) > 0$.