I have trouble answering the following question:
"Let $f: [0,+ \infty) \to \mathbb{R}$ be a function and consider the function $g: \mathbb{R}^2 \to \mathbb{R}: (x,y) \mapsto f(\left\lVert (x,y) \right\rVert)$. Give a necessary and sufficient condition on $f$ such that $g$ is totally differentiable."
I have tried to solve this and thought a good condition could be that $f$ is differentiable (I don't know if it is correct, though).
For the sufficiency of this condition, I have the following. Since $\mathbb{R}^2 \to \mathbb{R}: (x,y) \mapsto \left\lVert (x,y) \right\rVert$ is totally differentiable on $\mathbb{R}^2 \backslash \left\{(0,0)\right\}$, the chain rule gives us that $g$ is totally differentiable on $\mathbb{R}^2 \backslash \left\{(0,0)\right\}$. But then I don't know why $g$ would also be totally differentiable in $(0,0)$...
For the necessity of the condition, I don't know why total differentiability of $g$ would imply differentiability of $f$...
Thanks in advance for any help.