Absolutely continuous function not differentiable on uncountable set From real analysis one knows that an absolutely continuous function is differentiable a.e.. Is there a function showing that this statement cannot be made into "every AC function is differentiable except on a countable set of points"? 
 A: Let $C$ be the Cantor set and
$$f(x) = \operatorname{dist}(x, C), $$
then $f$ is $1$-Lipschitz and so, it is differentiable almost everywhere.
On the other hand, it is easy to prove that $f$ is not differentiable at any point on $C$. Indeed, write $c \in C$ as $c = \sum_{i\geq 1} 2a_i 3^{-i} $ with $a_i \in \{ 0, 1\}$ for all $i \geq 1$.
Case 1. Assume that either $a_i = 1$ eventually holds or $a_i = 0$ eventually holds. In such case, $c$ is the endpoint of some sub-interval appearing in the construction, and so, either the left-derivative of $f$ at $c$ is $-1$ or the right-derivative of $f$ at $c$ is $1$. On the other hand, since $c$ is a local minimum of $f$, the only possible value of $f'(c)$, if exists, is $0$. Since this is impossible by the previous observation, $f$ is not differentiable at $c$.
Case 2. Assume that both $0$ and $1$ appear infinitely many often in $(a_n)_{n\geq 1}$. Let
$$ c_n = \left( \sum_{i=1}^{n-1} 2a_i 3^{-i} \right) + \frac{3}{2} \cdot 3^{-n}. $$
Then $f(c_n) = \frac{1}{2}\cdot3^{-n}$, and so,
\begin{align*}
\frac{f(c_n) - f(c)}{c_n - c}
&= \frac{\frac{1}{2}\cdot3^{-n}}{\left(\frac{3}{2} - 2a_n \right)\cdot3^{-n} - \sum_{i>n} 2a_i 3^{-i}} \\
&= \frac{1}{(2 - 4a_n ) + 1 - 2 \sum_{i>n} 2a_i 3^{-(i-n)}}.
\end{align*}
Since $\left| 1 - 2\sum_{i>n} 2a_i 3^{-(i-n)} \right| \leq 1$, this tells that
$$ \frac{f(c_n) - f(c)}{c_n - c} \in \begin{cases}
[\frac{1}{3}, 1], & \text{if $a_n = 0$}; \\
[-1,-\frac{1}{3}], & \text{if $a_n = 1$}; 
\end{cases} $$
So this differential quotient cannot converge as $n\to\infty$, and so, $f$ is not differentiable at $c$.

This leaves an interesting question:

If $C$ is replaced by a fat Cantor set, still the corresponding distance function $f(x) = \operatorname{dist}(x, C)$ is $1$-Lipschitz. So $f$ must be differentiable with $f'(x) = 0$ for almost every $x \in C$.
Q. Can we characterize the point of differentiability of $f$?

