Differentiability of the composition of maps and Differentiability a.e.

Let $f: \mathbb{R} \rightarrow \mathbb{R}$ be non constant Lipschitzian function and $g : \mathbb{R} \rightarrow \mathbb{R}$ be differentiable a.e.in $\mathbb{R}$. Then it is easy to show that there exists $A \subset \mathbb{R}$ with positive Lebesgue measure and such that $g \circ f$ is differentiable at each point of A. I suspect that it is possible to find $f, g$ in such way that $g \circ f$ is not differentiable on a set with positive Lebesgue measure. Is it true? If it is so can anyone show an example?

PS. Of course if g is also Lipschitzian $g \circ f$ is Lipschitzian too!!

You did not assume $g$ continuous; to make the problem more interesting I make this additional assumption. Still, there is such an example. I present the construction in three parts.

1. A function whose set of non-differentiability is a given Cantor-type set

Let $C$ be a Cantor-type set, whether of zero measure or positive measure. Follow the process of carving $C$ from a line segment, but instead of just removing a piece of some interval $I$, bend it in a parabolic arc that is as tall as $I$ is long. Like this:

Let $h$ be the function whose graph we obtain in this way. To see that it is not differentiable on $C$, note that for every $x\in C$ and for every scale $\delta>0$, zooming in at that scale uncovers a picture similar to the one above. The graph is substantially non-linear on every scale.

2. Lipschitz map squeezing a fat Cantor set into thin one

Let $C_{1/3}$ be the standard middle-third Cantor set; it has zero measure. Let $C$ be the Cantor-type set obtained from $[0,1]$ by making gaps of size $3^{-n}/2$ instead of $3^{-n}$. The measure of $C$ is $1/2$. There is a natural $2$-Lipschitz map $f$ of $[0,1]$ onto itself that sends $C$ onto $C_{1/3}$: namely, stretch the gaps in $C$ by the factor of $2$ and place them where they belong in $C_{1/3}$. This map $f$ is a strictly increasing function, hence invertible.

3. Conclusion

Let $g = h\circ f^{-1}$. Then

1. $g$ is differentiable on the complement of $C_{1/3}$, hence a.e.
2. $g\circ f = h$ is not differentiable on $C$, which has positive measure.
3. $f$ is Lipschitz, as noted above.