Show that an increasing function has derivative $0$ a.e. Let $0<p<1$ and define $F:[0,1]\rightarrow[0,1]$ by $$F(x)=\begin{cases}
pF(2x),&x\in\left[0,\frac12\right]\\
p+qF(2x-1),&x\in\left[\frac12,1\right]
\end{cases}$$
where $q=1-p$.  I would like to prove that $F'(x)=0$ a.e.
I am working my way through "How to Gamble If You Must" by Kyle Siegerst, which is basically a series of exercises.  $F(x)$ is the probability that a gambler starting with a bankroll $0\leq x\leq 1$ will reach his target of $1$ if he engages in "bold play" in the game of red and black.  When his bankroll is $\leq\frac12$ he bets it all, winning the amount bet with probability $p$, and losing it with probability $q$.  When his bankroll is $>\frac12$, he bets just enough to reach the target, that is, $1-x$.
In the exercises, I have shown that there is a unique function $F$ satisfying the functional equation above, and that it is continuous and strictly increasing.  Following exercise $33$, the author remarks that when $p\neq\frac12$, $F'(X)=0$ a.e., so that $F$ is a devil's staircase.  I have been trying to prove this statement.  (I know that an increasing function is differentiable a.e.  It's the value that I'm having trouble with.)
Vague $50$-year-old memories of measure theory have led me to Proposition 3.31 in Folland's "Real Analysis", to wit
If $F\in NBV, \text{ then }F\in L^1(m).$  Moreover, $\mu_F\perp m \text{ iff } F' =0$ a.e., and $\mu_F \ll m \text{ iff } F(x)=\int_{-\infty}^xF'(t)dt. $
Here $m$ is Lebesgue measure, and a.e. is with respect to Lebesgue measure.  $\mu_F$ is the Borel measure defined by $\mu_F([a,b])=F(b)-F(a)$.  Folland uses $NBV$ to mean that $F$ is of bounded variation, $F(-\infty)=0$ and $F$ is right continuous.  This is no problem, as we can extend $F$ to $\mathbb{R}$ by defining $F(x)=0$ for $x<0$ and $F(x)=1$ for $x>1$.
So it seems to come down to showing $\mu_F\perp m$.  This means that there is an  $E\subset[0,1]$ with $m(E)=0$ and $\mu_F(E)=1$ if I'm not mistaken.  I don't see how to prove this.  Indeed it doesn't seem at all likely to me, so I must misunderstand something.
In exercise 29, I proved that $$F(x)=\sum_{n=1}^\infty p_{x_1}\cdots p_{x_{n-1}}px_n$$ where $x_i$ is bit number $i$ of $x$, and $p_0=p,\ p_1=q$.  (When $x$ is a dyadic rational, we take the terminating representation.)   If we represent wins by $1$ and losses by $0$, this means that the gambler reaches the goal if and only if the first time a bit in his bankroll matches the corresponding game bit, those bits are both $1$.  This is the most concrete representation of $F$ in the paper, but I don't see how it helps.
Can you cast any light on this for me?
 A: First note that $F$ is the cdf of the random variable $X:=\sum_1^{\infty} 2^{-n} \xi_n$ where the $\xi_n$ are i.i.d. Bernoulli$(p)$ random variables. Indeed, it is clear that that $X = \frac12\xi_1+\frac12 Y$, where $Y$ has the same distribution as $X$ and is independent of $\xi_1$. This gives the relation $$P(X\le x) = P(X\le x|\xi_1=0)P(\xi_1=0)+P(X \le x|\xi_1=1)P(\xi_1=1) $$$$= (pP(Y\leq 2x)+q\cdot 0)1_{\{x \le 1/2\}} + (p\cdot 1 +qP(Y\leq 2x-1))1_{\{x >1/2\}},$$ which is exactly the relation for $F$.
Now note by the strong law of large numbers that $X$ is supported on the set of real numbers whose binary expansion has asymptotic density $p$ of $1$'s (or equivalently, has asymptotic density $q$ of $0$'s).
But the set of all such real numbers has Lebesgue measure zero. Indeed, if we uniformly sample a real number from $[0,1]$, then its binary digits are i.i.d. Bernoulli$(1/2)$, thus almost surely the asymptotic density of $1$'s is $1/2$, not $p$.
We conclude that the law of $X$ is singular with respect to Lebesgue measure, which is equivalent to the condition that $F'=0$ a.e..
