Suppose that $f: \mathbb{R} \to \mathbb{R}$ is differentiable at $c$ and that $f(c)=0$. Show that $g(x)=|f(x)|$is differentiable at $c$ iff $f'(c)=0$
$\implies$
Suppose $g'(c)$ exists
Then we have that for $x<c$, $\lim_{x \to c}\frac{g(x)-g(c)}{x-c}$ =$\lim_{x \to c}\frac{|f(x)|}{x-c} \le 0$
and for $x>c$, $\lim_{x \to c}\frac{g(x)-g(c)}{x-c}$ =$\lim_{x \to c}\frac{|f(x)|}{x-c} \ge 0$
Then, by squeeze theorem, we have that $g'(c)=0$
Can anyone please tell me how to use the aforementioned result to get to the point where I can show that $f'(c)=0$?
$\impliedby$
$f'(c) = 0 \implies \lim_{x \to c}\frac{f(x)}{x-c} =0$ $\implies |f'(c)|=0 = g'(c)$
Can anyone please verify this proof and also help arrive at the result that is emboldened? I'd also appreciate if you could lend some tips/hints to approach such questions and if there are easier ways to proof this.
Thank you.
Hint:
$$ \left|\frac{|f(x)| -|f(c)|}{x-c} - 0\right|= \frac{|f(x)|}{|x-c|} = \left|\frac{f(x) - f(c)}{x-c}- 0\right|$$