TITLE: Examples of badly behaved derivatives 
QUESTION [10 upvotes]: Consider a real valued function g on an open interval $(a,b)$ which is the derivative of a function continuous on $[a,b]$ at each point of $(a,b)$. The function $g$ has the intermediate value property, so a monotone $g$ will have to be continuous, a general $g$ cannot have simple discontinuities, etc. With such constraints how badly can a derivative behave in terms of continuity, can it get much worse than the derivative of say, $x^2 \sin(1/x)
$?

REPLY [5 votes]: In Y. Katznelson and K. Stromberg’s paper “Everywhere differentiable, nowhere
monotone, functions,” Amer. Math. Monthly 81 (1974), no. 4, 349–354 (doi: 10.1080/00029890.1974.11993558, JSTOR), there is a construction, based on somewhat similar ideas to those described in Majer’s above mentioned article, whereby for any two disjoint countable sets $A, B \subset \mathbb{R}$ there exists a differentiable function whose derivative equals $1$ on $A$ and is less than $1$ on $B$.   So if $A$ and $B$ are both dense in $\mathbb{R}$ then this derivative must be discontinuous at every point of $B$.