Is a continuous function with derivative zero a.e. of bounded variation? Let $f:[a,b] \to \mathbb{R}$ be a continuous function and suppose that $f$ is differentiable a.e. and that $f'(t) = 0$ for almost all $t \in [a,b]$. Is it true, that then $V_a^b(f) < \infty$, where $V_a^b(f)$ is the variation of $f$ on $[a,b]$? 

One can build a counter-example by gluing together Cantor-like functions. Let $C(x)$ be the Cantor staircase function on $[0,1]$. Then $C$ is continuous, monotone, $C(0) = 0 $ , $C(1) = 1$ and $C'(x) = 0$ a.e. in $[0,1]$. Consider the function
$$
C_0(x) = \begin{cases} C(x) ,&\text{  $x \in [0,1/2] $}, \\
C(1 - x )  ,&\text{  $ x\in [1/2, 1]  $.}    \end{cases}
$$
Notice that $C_0$ is simply the function $C(x)$ in the interval $[0,1/2]$ and is the mirror reflection, with respect to the line $x = 1/2$, of $C(x)$ in the range $[1/2,1]$.
Clearly $C_0$ is continuous and has vanishing derivative a.e. in $[0,1]$, also $C_0(0) = C_0(0)= 0 $, and $V_0^1 (C_0) = 1$.
We will assume that $C_0$ is extended as identically $0$ to the entire real line. Now 
for each $n\in \mathbb{N}$ define 
$$
C_n(x) = \frac{1}{n}C_0\left( 2^n x - 1 \right) , \ x\in \mathbb{R},
$$ 
which is simply the function $\frac 1n C_0$ but scaled to have support on the interval 
$\Delta_n: = [2^{-n}, 2^{1-n}]$.
The total variation of $C_n$ on $[0,1]$ equals $\frac{1}{n} V_0^1 (C_0) = \frac 1n$.
Finally, define
$$
F(x) = \sum\limits_{n=1}^\infty C_n(x), \ x \in [0,1].
$$
The intervals $\Delta_n$ cover $[0,1]$ as $n\in \mathbb{N}$ and only intersect at the endpoints where $C_n = 0$, and since $|C_n|\leq 1/n$ the series representing $F$ converge uniformly on $[0,1]$, implying that $F$ is continuous. Again, in view of non-overlapping supports of functions $\{C_n\}$, we have $F'(x) = 0 $ a.e. in $[0,1]$, while 
$$V_0^1 (F) = \sum\limits_{n=1}^\infty V_0^1(C_n) = \sum\limits_{n=1}^\infty \frac 1n = \infty.$$
