Answer
Using the Chain Rule, we evaluate the derivatives of $g\left( r \right)$ with respect to ${x_i}$ and obtain
$\frac{{{\partial ^2}g}}{{\partial {x_i}^2}} = \frac{{{x_i}^2}}{{{r^2}}}{g_{rr}} + \frac{{{r^2} - {x_i}^2}}{{{r^3}}}{g_r}$
Work Step by Step
We have $r = \sqrt {{x_1}^2 + ... + {x_n}^2} $. Let $g\left( r \right)$ be a function of $r$.
The partial derivative of $r$ with respect to ${x_i}$ is
$\frac{{\partial r}}{{\partial {x_i}}} = \frac{{{x_i}}}{{\sqrt {{x_1}^2 + ... + {x_n}^2} }} = \frac{{{x_i}}}{r}$
Using the Chain Rule, we evaluate the derivative of $g\left( r \right)$ with respect to ${x_i}$:
$\frac{{\partial g}}{{\partial {x_i}}} = \frac{{dg}}{{dr}}\frac{{\partial r}}{{\partial {x_i}}}$
$\frac{{\partial g}}{{\partial {x_i}}} = \frac{{{x_i}}}{r}{g_r}$
Taking another derivative with respect to ${x_i}$ gives
$\frac{{{\partial ^2}g}}{{\partial {x_i}^2}} = \frac{\partial }{{\partial {x_i}}}\left( {\frac{{{x_i}}}{r}{g_r}} \right) = \frac{\partial }{{\partial {x_i}}}\left( {\frac{{{x_i}}}{r}} \right){g_r} + \frac{{{x_i}}}{r}\frac{{\partial {g_r}}}{{\partial {x_i}}}$
${\ \ \ }$ $ = \left( {\frac{{r - {x_i}^2/r}}{{{r^2}}}} \right){g_r} + \frac{{{x_i}}}{r}\left( {\frac{{{x_i}}}{r}{g_r}} \right)$
${\ \ \ }$ $ = \left( {\frac{{{r^2} - {x_i}^2}}{{{r^3}}}} \right){g_r} + \frac{{{x_i}^2}}{{{r^2}}}{g_{rr}}$
Hence,
$\frac{{{\partial ^2}g}}{{\partial {x_i}^2}} = \frac{{{x_i}^2}}{{{r^2}}}{g_{rr}} + \frac{{{r^2} - {x_i}^2}}{{{r^3}}}{g_r}$