I'm a university student taking a real-analysis course and I have been given the following questions regarding the behaviour of the above composite function around $x=5$
Firstly it asks to explain why the chain rule tells us nothing about the differentiablity of the composition $g \circ f$ at $x=5$.
And secondly, to show $g \circ f$ is not differentiable at $x = 5$.
The chain rule states. Suppose that $f:S \rightarrow \mathbb{R}, g:T \rightarrow\mathbb{R}$ and f has range in $T$. Suppose that $f$ is differentiable at $a$ and $g$ is differentiable at $f(a)$. Then $g \circ f$ is differentiable at $a$ with $(g \circ f)'a = g'(f(a))f'(a)$
After looking at a graph of $f \circ g$ it can be observed the limit does not exist at $x=5$ and $x = -2$ so by the definition of the theorem $g$ is not differentiable at $f(5)$ so it says nothing.
As for showing rigorously that $g \circ f$ is not differentiable at $x = 5$ I'm having a little trouble getting started. If anyone has any tips it would be much appreciated!
Thanks for your time.
Remember that the chain rule states that if $g$ is differentiable at $f(x)$ and $f$ is differentiable at $x$ then $g \circ f$ is differentiable at $x$ and
$$ (g \circ f)'(x) = g'(f(x)) f'(x).$$
In this case you now that $g: x \mapsto \vert x \vert $ is differentiable when $x \neq 0$ but $f(5) = 0$ so you can't apply the chain rule at $x = 5$ since $g$ is not differentiable at $f(5)$ ! Therefore the chain rule tells you nothing about the differentiability of $g\circ f$ at $x= 5$.
To show that $g \circ f : x \mapsto \vert x-5\vert \vert x+2 \vert$ is not differentiable at $x = 5$ you must consider the limit as $ h \to 0$ of
$$ Q_h =\frac{g(f(5 + h)) - g(f)(5)}{h} = \frac{\vert h \vert \vert h + 7\vert }{h}$$
This limit doesn't exist since $Q_h$ will be positive or negative depending on whether $h <0$ or $h>0.$