I am trying to show that the function:
$$u(x)=|x|^{(2-n)}$$
is harmonic where $x$ is a vector in $\mathbb{R}^n\setminus\{0\}$
Here is what I tried:
$\displaystyle u(x)=|x|^{(2-n)}$
$\displaystyle $$\frac{\partial u(x)}{\partial x_{i}}=x_{i}(2-n) |x|^{(1-n)}$, where here we are differentiating with respect to $\displaystyle x_{i}$, the $i$th value of the vector $x$.
$\displaystyle $$\frac{\partial^{2} u(x)}{\partial x_{i}^{2}}=(2-n) |x|^{(1-n)}+x_{i}^2(2-n)(1-n) |x|^{-n}$
$\Delta u=\sum_{j=1}^{n} $$\frac{\partial^{2} u(x)}{\partial x_{i}^{2}}=n(2-n) |x|^{(1-n)}+(2-n)(1-n) |x|^{2-n}$
From here, I can't see how to get this equal to zero or where I've gone wrong. Thanks.
There is already an error in your calculation of the first partial derivative.
The derivative of $ \lvert x\rvert = \sqrt{x_1^2 + \ldots + x_n^2}$ with respect to $x_i$ is
$$ \frac {2 x_i}{2 \sqrt{x_1^2 + \ldots + x_n^2}} = \frac {x_i}{\lvert x \rvert} $$
for $x \ne 0$, and therefore
$$ \frac{\partial u(x)}{\partial x_{i}} = (2-n) \, \lvert x \rvert^{(1-n)} \, \frac {x_i}{\lvert x \rvert} = (2-n) \, x_i \, \lvert x \rvert ^{-n} \quad . $$
From there you should get the expected result.