# Construct a monotonic function $f$ on $\Bbb R$ so that $f'(x)$ exists (finitely) for every $x\in \Bbb R$ but $f'$ is not a continuous function.

This is an exercise from Rudin's Real and Complex Analysis book.

Construct a monotonic function $f$ on $\Bbb R$ so that $f'(x)$ exists (finitely) for every $x\in \Bbb R$ but $f'$ is not a continuous function.

How can I construct such a function?

• What does this question have to do with measure theory? – Omnomnomnom Feb 26 '17 at 23:28
• Discontinuous in how many points? – Yiorgos S. Smyrlis Feb 26 '17 at 23:31
• @Omnomnomnom Maybe the function is almost an integral or something like that? I don't know. It is in a measure theory book. – Filburt Feb 26 '17 at 23:32
• @YiorgosS.Smyrlis At least one, I think – Filburt Feb 26 '17 at 23:32
• @YiorgosS.Smyrlis Well it has to be a finite amount otherwise $f^\prime$ wouldn't exist over every $x\in \mathbb R$. However one should work. – Sentinel135 Feb 26 '17 at 23:35

Example $$f(x)=\left\{ \begin{array}{ccc} 2x & \text{if} & x\le 0,\\ 2x+x^2+x^2\sin(1/x) & \text{if} & x> 0. \end{array} \right.$$ Then $$f'(x)=\left\{ \begin{array}{ccc} 2 & \text{if} & x\le 0,\\ 2+2x+2x\sin(1/x)-\sin(1/x) & \text{if} & x> 0. \end{array} \right.$$

Clearly $f$ is increasing and differentiable everywhere, but $f'$ is discontinuous at $x=0$.

$$f(x)=\begin{cases} x^2\sin(1/x) & x\neq 0\\ 0 & x=0 \end{cases}$$
$$f'(x)=\begin{cases} 2x\sin(1/x) -\cos(1/x) & x\neq 0 \\ 0 & x = 0 \end{cases}$$ is discontinous at $x=0$. However $f'(x)$ is bounded. So let $C$ be some lower bound of $f'$. Define $g(x)=f(x)+Cx$. Then $g'(x)=f'(x)+C > 0$ everywhere and thus by the first derivative test $g$ is increasing yet $g'$ is still discontinous at $x=0$.