In order to calculate the variance, use the following formula:

where μ is the mean of the data.
Then, calculate μ:
μ = (1+2+3+4+5)/5 = 3
and replace this value and the values of xn and P(xn) into the formula for the variance, just as follow:

Hence, the variance of the given distribution is 0.9