Bartle, Introduction to Real Analysis (2011 4 ed), Ex 14, Section 6.2, p 179. Let $I$ be an interval and let $I : I \rightarrow \mathbb{R}$ be differentiable on $I$. Show that if the derivative $f'$ is never $0$ on $I$, then either $f'(x) &gt; 0$ for all $x \in I$ or $f' (x) &lt; 0$ for all $x \in I$.

I was thinking to proceed by Darboux's theorem. Is that correct?
Write out the book's details, like section and page numbers, as I did. You're correct. Here are details.  In his solution manual, Bartle wrote


Apply Darboux’s Theorem 6.2.12.
Write out the book's details, like section and page numbers, as I did. You're correct. Here are details.  In his solution manual, Bartle wrote


Apply Darboux’s Theorem 6.2.12.