Given a continuous function $g$ on $\mathbb R$. Is it possible to decompose $\mathbb R$ as the union of a countable collection of intervals $I_n=]a_n, a_{n+1}]$ so that $g$ is monotone on each $I_n$?
The same question may be asked for a continuous function defined on a bounded interval.