Nonzero derivative implies function is strictly increasing or decreasing on some interval Let $f$ be a differentiable function on open interval $(a,b)$. Suppose $f'(x)$ is not identically zero. Show that there exists an subinterval $(c,d)$ such that $f(x)$ is strictly increasing or strictly decreasing on $(c,d)$.
How to prove this?
I think this statement is wrong...
 A: I show that it's true in case $f$ is not only differentiable but also its derivative is continuous.
Since $f'$ is non-zero function, there is a point $\tilde{x} \in (a, b)$ such that $f'(\tilde{x}) > 0$ or $f'(\tilde{x}) < 0$. Suppose $f'(\tilde{x}) > 0$. Then take $c$ and $d$ as follows:
$$ \begin{align*}
c &:= \inf\{\, \tilde{c} \mid a \leq \tilde{c} \leq \tilde{x}, \quad f'(c') > 0 \quad \text{for all $c' \in (\tilde{c}, \tilde{x}]$} \,\} \\
d &:= \sup\{\, \tilde{d} \mid \tilde{x} \leq \tilde{d} \leq b, \quad f'(d') > 0 \quad \text{for all $d' \in [\tilde{x}, \tilde{d})$} \,\}. \\
\end{align*}$$
From assumption that $f'$ is continuous, $c \neq \tilde{x} \neq d$. The interval $(c, d)$ is the required one (indeed, the largest interval containing $\tilde{x}$).
A: The statement is indeed wrong.  You can construct for example a function $f:\mathbb{R} \rightarrow\mathbb{R}$ which is differentiable everywhere such that both $\{x \in \mathbb{R} : f'(x) > 0\}$ and $\{x \in \mathbb{R} : f'(x) < 0\}$ are dense in $\mathbb R$ and thus $f$ is monotone on no interval.  You can find such a construction on page 80 of A Second Course on Real Functions by van Rooij and Schikhof.  See also here.
A: I also think the statement is not true. There are examples of a function that has derivative positive but it is not monotone in any neighborhood of that point. Consider $\phi(0)=0$ and for $x\neq 0$ consider
$$\phi(x)=x^2 \sin\left(\dfrac{1}{x}\right)+\dfrac{x}{2}$$
This function is continuous, $\phi^\prime(0)>0$ but not monotone near zero
