As the chain rule states:
If $f(u)$ is differentiable at point $u=g(x)$, and $g(x)$ is differentiable at $x$, then the composite function $(f\circ g)(x)=f(g(x))$ is differentiable at $x$ , and $$(f\circ g)'(x)=f'(g(x)).g'(x).$$
Then the question says:
We are given: $f(x)=x^2$ and $g(x)=|x|$. Then the composites $(f\circ g)(x)=|x|^2=x^2$ and $(g\circ f)(x)=|x^2|=x^2$ are both differentiable at $x=0$ even though $g$ itself is not differentiable at $x=0$. Does this contradict the chain rule?
I think it's not so because chain rule says that $f(u)$ is differentiable at $u=g(x)$, and $g(x)$ is differentiable at $x$, and does not imply vice-versa. Am I correct?