TITLE: How irregular can $f'$ be beyond Darboux's Theorem?
QUESTION [5 upvotes]: By Darboux's theorem if $f:D\to\mathbb R$ is differentiable then $f'$ satisfies the intermediate value property $-$ even if it is discontinuous. In particular I am interested in the following:
Assume $f'(a)<f'(b)$ for some $a<b$. We know that then $f'$ assumes every value in the interval $I=[f'(a),f'(b)]$ within $[a,b]$. Does this imply that $(f')^{-1}\big(I\big)$ has postive measure?
Intuitively it seems like it must be true; but how to prove it? This question is related to a comment I made on this thread.
Note that if $g:D\to\mathbb R$ has the intermediate value property, but is not the derivative of a differentiable function, then it can be quite volatile $-$ see for instance Conways base 13 function. Here, the pre-image of $I$ could only be described as a mess.
Some related stuff:

https://math.stackexchange.com/a/292380/99220
Volterra's function as an example of a very badly behaved derivative (set of discontinuities of $V'$ has positive measure).
Cantors function (or rather its integral) is not a counter-example since the intersection of the complement of the cantor set with any (open) interval contains an (open) interval.

REPLY [2 votes]: With those assumptions, $(f')^{-1}(I)$ has positive measure. There is a proof here: https://mathoverflow.net/questions/266377/how-quickly-can-the-derivative-of-an-everywhere-differentiable-function-change-s. Here is an alternate argument for anyone interested.
Assume not, so $(f')^{-1}(I)$ has zero measure. By scaling and adding a linear function we may assume $I=[0,1],$ specifically $f'(a)=0$ and $f'(b)=1.$ We will construct a nested sequence of closed intervals $[a_n,b_n]$ such that the divided difference $d_n=\frac{f(b_n)-f(a_n)}{b_n-a_n}$ satisfies $d\in(0,1/3)$ for odd $n$ and $d\in(2/3,1)$ for even $n.$
To get started, if $f(b)-f(a)$ is positive, by continuity there is some $x\in (a,b]$ such that $(f(x)-f(a))/(x-a) \in (0,1/3)$; in this case start at $n=1$ with $a_1=a$ and $b_1=x.$ If $f(b)-f(a)$ is negative, there is some $x\in [a,b)$ with $(f(b)-f(x))/(b-x)\in (2/3,1)$; in this case start at $n=0$ instead of $n=1,$ and take $a_0=x$ and $b_0=b.$
Assume we have constructed $[a_n,b_n]$ with $n$ even, so $d_n\in(2/3,1).$
This means the (Henstock-Kurzweil) average value of $f'$ on $[a_n,b_n]$ is less than $1.$ Since $(f')^{-1}([0,1])$ has zero measure, there is some $x\in [a_n,b_n]$ with $f'(x)<0.$ Either $(f(b_n)-f(x))/(b_n-x)$ or $(f(x)-f(a_n))/(x-a_n)$ is positive, because $d_n$ is a convex combination of these ratios. In the first case we take $a_{n+1}=x$ and take $b_{n+1}\in(x,b_{n+1}]$ such that $d_{n+1}\in(0,1/3),$ which exists by continuity. In the second case is take $b_{n+1}=x$ and $a_{n+1}\in[a_n,x)$ such that $d_{n+1}\in(0,1/3).$ Similarly, given $[a_n,b_n]$ with $n$ odd, the same argument applied to $x-f(x)$ gives a $[a_{n+1},b_{n+1}]$ with $d\in(2/3,1).$
This completes the construction of the sequence of intervals $[a_n,b_n].$ If $\lim (b_n-a_n)>0$ then $d_n$ would converge to $(f(\lim b_n)-f(\lim a_n))/\lim(b_n-a_n).$ If $\lim (b_n-a_n)=0$ then $a_n$ and $b_n$ converge to some common point $x,$ but then $d_n$ would have to converge to $f'(x).$ In either case $d_n$ has to converge but, by construction, it doesn't.