Does the derivative of a differentiable function have to be Lebesgue integrable in some interval? I know that the derivative of a differentiable function doesn't have to be continuous.  How discontinuous can a derivative be?.
Inspired by Limits and continuity of a derivative, I was thinking of defining the notion of pseudo-continuous: $f:(a,b) \to \mathbb R$ is pseudo-continuous at $x \in (a,b)$ if
$$ f(x) = \lim_{y\to x} \frac1{y-x} \int_x^y f(t) \, dt .$$
And then I wanted to show that a function is the derivative of a differentiable function if and only if it is pseudo-continuous.
But then I realized that the derivative doesn't have to be Lebesgue integrable, for example
$$ f(x) = \frac x{\log|x|} \sin\left(\frac1x\right) , \quad x \in (-\tfrac12,\tfrac12) ,$$
or
$$ f(x) = x^2 \sin\left(\frac1{x^2}\right)  ,$$
Does there exist a differentiable function $f:(0,1) \to \mathbb R$ such that its derivative restricted to any subinterval of $(0,1)$ fails to be in $L^1$?
 A: The derivative is the (pointwise) limit of a sequence of continuous functions, e.g.
$$g_n(x) = \frac{f(x + h_n(x)) - f(x)}{h_n(x)}$$
where we can take $h_n(x) = \frac{1}{n+1}$ if $b = +\infty$, and if $b < +\infty$ we can take $h_n(x) = \frac{b-x}{n+1}$. It follows that the family $\{ \lvert g_n\rvert :  \in \mathbb{N}\setminus \{0\}\}$ is pointwise bounded.
Take an arbitrary nonempty interval $(u,v) \subset (a,b)$. For each $k \in \mathbb{N}$ the set
$$A_k = \bigl\{ x \in (u,v) : \lvert g_n(x)\rvert\leqslant k \text{ for all } n\bigr\}$$
is relatively closed, and since the family is poinwise bounded we have
$$(u,v) = \bigcup_{k \in \mathbb{N}} A_k\,.$$
Furthermore, $(u,v)$ is a Baire space (it's completely metrisable), hence there is a $k \in \mathbb{N}$ such that
$$V = \operatorname{int} A_k \neq \varnothing\,.$$
Then $\lvert f'(x)\rvert \leqslant k$ for all $x \in V$
Thus every nonempty open interval in $(a,b)$ contains a nonempty open interval on which $f'$ is bounded. This means the set of points $x$ such that $f'$ is Lebesgue integrable on some neighbourhood of $x$ is a dense open subset of $(a,b)$, hence topologically very large.
However, the measure of this set would be the more important type of size. I don't know whether it can be arbitrarily small (of course it's nonzero), but I suspect it can.
A: I assert the answer is "no."
Theorem:  Let $f:(a,b) \to \mathbb R$ be differentiable.  Then there exists a subinterval $[u,v] \subset (a,b)$ such that $f'$ is uniformly bounded on $[u,v]$.
Proof: Suppose the converse is true.  Suppose $\epsilon = \frac1{100}$.
Recursively pick sequences $y_n$, $\delta_n$ as follows.
Pick $y_1$ such that $|f'(y_1)| \ne 0$.  Given $y_n$, choose $\delta_n > 0$ so that $[y_n - \delta_n, y_n+\delta_n] \subset (a,b)$, and so that if $|h| < \delta_{n}$, we have that
$$ (1-\epsilon) |f'(y_n)| \le \left| \frac{f(y_n) - f(y_n+h)} h \right| \le (1+\epsilon)|f'(y_n)| ,$$
and so that if $n > 1$, then
$$ \delta_n \le \frac{|f'(y_{n-1})|}{8|f'(y_{n})|} \delta_{n-1} .$$
Next, by hypothesis, there exists a point
$$ y_{n+1} \in (y_n-\delta_n,y_n-\tfrac12\delta_n) $$
such that $|f'(y_{n+1})| \ge 2 |f'(y_n)|$.
Note that for $n \ge m > 1$
$$ |y_n - y_{n+1}| \le \delta_n \le 16^{m-n} \delta_m \le 2 \times 16^{m-n} |y_{m} - y_{m+1}| ,$$
In particular, the points $y_n$ form a Cauchy sequence.  Let $y = \lim_{n\to \infty} y_n$.
Then
\begin{align} |y - y_m| &= \left|\sum_{n=m}^\infty y_{n+1} - y_n \right|
\\ & \le \sum_{n=m}^\infty |y_{n+1} - y_n|
\\ & \le |y_{m+1} - y_m| \sum_{n=m}^\infty 2\times 16^{m-n}
\\ & \le \frac{32}{15} |y_{m+1} - y_m| .
\end{align}
Also
\begin{align} |f(y) - f(y_m)| &= \left|\sum_{n=m}^\infty (f(y_{n+1}) - f(y_n)) \right|
\\ & \ge |f(y_{m+1}) - f(y_m)| - \sum_{n=m+1}^\infty |f(y_{n+1}) - f(y_n)| 
\\ & \ge (1-\epsilon) |f'(y_m)| |y_{m+1} - y_{m}| - (1+\epsilon) \sum_{n=m+1}^\infty |f'(y_n)||y_{n+1} - y_{n}|
\end{align}
Now
$$
|f'(y_{n+1})||y_{n+2} - y_{n+1}|
\le
|f'(y_{n+1})|\delta_{n+1}
\le
\frac18 |f'(y_{n})|\delta_{n}
\le
\frac14 |f'(y_n)||y_{n+1} - y_{n}| .
$$
So
\begin{align} |f(y) - f(y_m)| & \ge (1-\epsilon) |f'(y_m)| |y_{m+1} - y_{m}| - (1+\epsilon) |f'(y_m)| |y_{m+1} - y_{m}| \sum_{n=m+1}^\infty 4^{m-n}
\\ & \ge \frac18 |f'(y_m)| |y_{m+1} - y_{m}| .
\end{align}
Thus
$$ \left| \frac{f(y) - f(y_m)}{y-y_m} \right| \ge  \frac{15}{256} |f'(y_m)| .$$
But $|f'(y_m)| \ge 2^m |f'(y_1)| \to \infty$, and this contradicts that $f$ is differentiable at $y$.
