This is an exercise of my course of PDE:
Show all the harmonic functions over $\mathbb{R}^N\setminus\{0\}$ such that $u(x)=f(|x|)$.
My Attempt
A function $g$ is called harmonic if $\Delta g=\sum_{i=1}^N\frac{\partial^2g}{\partial x_i^2}=0$. Let $r(x)=|x|$. We have that $u(x)=(f\circ r)(x)$. So
$$
\frac{\partial(f\circ r)(x)}{\partial x}=\frac{\partial f(r(x))}{\partial r(x)}\frac{\partial r(x)}{\partial x}=\pm \frac{\partial f(r(x))}{\partial r(x)}
$$
and
$$
\frac{\partial f(r(x))}{\partial r(x)}=f'(x)
$$
So,
$$
\frac{\partial^2(f\circ r)}{\partial x^2}=\pm f''(x)\geq 0
$$
As $u(x)=f(|x|)=(f\circ r)(x)$, we give that $u(x)$ is harmonic if
$$
\frac{\partial^2 u(x)}{\partial x_i^2}=0, \forall i\in {1,...,N}
$$
I`m insecurity with this soluction.
A couple of things here went wrong, firstly the $x_i$ derivative of $|x|=\sqrt{x_1^2+...+x_n^2}$ is $\frac{x_i}{\sqrt{x_1^2+...+x_n^2}}=\frac{x_i}{r}$.
And we seek $f(r)=g(x)$
And the $r$ derivative of $f$ is $f'(r)$ not $f'(x)$. Then we carefully calculate that the second $x_i$ derivative of $f$ to be $f''(r)\frac{x_i^2}{r^2}+f'(r)(\frac{1}{r}-\frac{x_i^2}{r^3})$
This should put you on better footing.
In conclusion sum what we have found to get:
$-\Delta g = -(f''(r)+\frac{n-1}{r}f'(r))=0$
Solve this linear second order ODE to obtain:
$f(r)= \left\{ \begin{array}{ccc} b\ln(r)+c & \text{if } n=2\\ \frac{b}{r^{n-2}}+c & \text{if } n\ge 3 \end{array} \right\} $
Put this back in terms of $x$ and you have your solution.