The sample mean is given by:
$M=\dfrac{\sum_{i=1}^n x_i}{n}$
where $x$ is your individual observations and $n$ the number of observations.
Before you added the observation you have:
$5=\dfrac{\sum_{i=1}^7 x_i}{7}$
And after you add the observation you have:
$6=\dfrac{\sum_{i=1}^8 x_i}{8}$
Given these you can solve for the sums of $x_i$
These turn out to be:
$\sum_{i=1}^7 x_i=5 \times 7 = 35$
$\sum_{i=1}^8 x_i=6 \times 8 = 48$
We know that the above summations share the first $7$ observations. Therefore we can find the value of the new observation by taking the difference.
$x_8=\sum_{i=1}^8 x_i- \sum_{i=1}^7 x_i=48 - 35 = 13$
Therefore your new observation is $13$
Some further explanation:
We may also write $\sum_{i=1}^7 x_i=x_1 + x_2 + x_3 +x_4 + x_5 +x_6 +x_7$
As we, we may write: $x_8=\sum_{i=1}^8 x_i = x_1 + x_2 + x_3 +x_4 + x_5 +x_6 +x_7 +x_8$
We had shown that $\sum_{i=1}^7 x_i=x_1 + x_2 + x_3 +x_4 + x_5 +x_6 +x_7=35$
Therefore, we may substitute this into the equation for $\sum_{i=1}^8 x_i$:
$\sum_{i=1}^8 x_i = x_1 + x_2 + x_3 +x_4 + x_5 +x_6 +x_7 +x_8 = 35 +x_8$
Since using the formula for the mean we also shown:
$\sum_{i=1}^8 x_i= 45$
Then we have:
$45 = 35 + x_8$
and simply solving for $x_8$:
$x_8 = 13$