Consider the functions f(x)=∣x∣ and g(x)=x3. We have that f is not differentiable at x=0 and g takes on all real values. Moreover,
f(g(x))={x3,−x3,x≥0,otherwise.So
(f∘g)′(x)={3x2,−3x2,x≥0,x<0.For x=0,
h→0+limhf(g(h))=h→0+limh∣h3∣=h→0+limh2=0and
h→0−limhf(g(h))=h→0−limh∣h3∣=h→0−lim−h2=0.Hence, f∘g is differentiable.