One trick here is to note that $f$ is invariant under rotations, so we might get some mileage out of using polar coordinates. In polar coordinates, $$f(r,\theta_1,\ldots,\theta_{n-1}) = r^{2-n}$$
and the Laplacian has the expression
$$\Delta = \frac{1}{r^{n-1}}\frac{\partial}{\partial r}\bigg(r^{n-1}\frac{\partial}{\partial r}\bigg) + r^{-2}\bigg(\mbox{angular derivatives}\bigg)$$
As $f$ depends only on $r$, the angular derivatives vanish, so
$$\begin{align*}
\Delta f &= \frac{1}{r^{n-1}}\frac{\partial}{\partial r}\bigg( r^{n-1} \frac{\partial}{\partial r} r^{2-n}\bigg) \\
&= \frac{1}{r^{n-1}}\frac{\partial}{\partial r}\bigg(r^{n-1}(-n+2)r^{1-n}\bigg) \\
&= \frac{2-n}{r^{n-1}}\frac{\partial}{\partial r}(1)\\
&= 0
\end{align*}$$