# Decomposition of a continuous function with monotone functions

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.

-

You might think about the Weierstrass function. I think you can prove it is not monotone over any interval by altering the proof that it is not differentiable.

-

Whenever someone comes with a guess as to whether continuous functions are "nice" in some way, the answer is almost inevitably "no". For example this other question.

And the Weierstraß function is likewise a counterexample to your question. Note that it is not of bounded variation.

EDIT: Made the opening line less... confrontational.

-

The function $f(x) = x \sin(1/x)$ is continuous on $\mathbb{R}$ and is not monotone on any nontrivial interval containing $0$. For that matter, the same holds for $f_a(x) = x^a \sin(1/x)$ for any positive integer $a$, and this gives a (simple!) example which is highly differentiable: i.e., $k$ times differentiable for each fixed $k$ and all sufficiently large $a$.

-
If you extend the original question in the obvious way, allowing $\mathbb R$ to be formed as a unions of half-open intervals and singletons, this doesn't resolve the question. The positive half-line can be decomposed as a countable number of intervals of monotonicity, as can the negative half-line. –  Niel de Beaudrap Nov 1 '10 at 14:33
Although this is a good example, it's not true in general that $x^a\sin(1/x)$ is $a-1$ times differentiable. The true order of differentiability is nearer $a/2$. –  Robin Chapman Nov 1 '10 at 15:50
@Robin: thanks for the comment. –  Pete L. Clark Nov 1 '10 at 18:08