Let $f : [a, b] \rightarrow R$ be differentiable. If $f'(x) \neq 0$ for all $x \in [a, b]$, then show that either $f'(x) \geq 0$ for all $x\in [a, b]$ or $f'(x) \leq 0$ for all $x \in [a, b].$
I'm not sure how I can exactly reach to the result. I have to show $f(x)$ is either strictly monotonic increasing or strictly monotonic decreasing. Please solve.