So, I have the question and I also have the answer.
Need to prove:

And here is the answer

Can you please explain the steps. They are in the second picture but I do not understand where they are coming from.
Thank you in advance.
So, I have the question and I also have the answer.
Need to prove:

And here is the answer

Can you please explain the steps. They are in the second picture but I do not understand where they are coming from.
Thank you in advance.
On
By definition it is $\overline X=\frac{1}{n}\sum_{i=1}^n X_i$. Now you can multiply both sides by n. $\overline X$ is the arithmetic mean of the $X_i´s$.
And here $\sum_{i=1}^n \overline X$ you can factor out $\overline X$, because $\overline X$ is not indexed. Thus $\sum_{i=1}^n \overline X=\overline X \cdot \sum_{i=1}^n 1$. And $\sum_{i=1}^n 1=n$. Thus $\sum_{i=1}^n \overline X=n\cdot \overline X$
On
Most likely, $\bar{X}$ is referring to the arithmetic mean of a set $\{X_1, X_2, ..., X_n\}$ Now, since the arithmetic mean is defined as $$\frac{X_1+X_2+...+X_n}{n}=\bar{X}$$ it is equivalent to say that $$X_1+X_2+...+X_n=n\bar{X}$$ and then of course using summation notation $$\sum_{i=1}^n{X_i}=n\bar{X}$$ Since the arithmetic mean of a number is just a constant, if I add up $\bar{X}$ n times it is the same as multiplying $\bar{X}$ by $n$. This gives me $$\bar{X}+\bar{X}+...+\bar{X}=n\bar{X}$$ and then of course using summation notation $$\sum_{i=1}^n{\bar{X}}=n\bar{X}$$Therefore $$\sum_{i=1}^n{(X_i-\bar{X})}=(X_1-\bar{X})+(X_2-\bar{X})+...+(X_n-\bar{X})$$ rearranging by commutativity $$=X_1+X_2+...+X_n-\bar{X}-\bar{X}-...-\bar{X}$$ $$=(X_1+X_2+...+X_n)-(\bar{X}+\bar{X}+...+\bar{X})$$ $$=\sum_{i=1}^n{X_i}-\sum_{i=1}^n{\bar{X}}$$ $$=\sum_{i=1}^n{X_i}-n\bar{X}$$ $$n\bar{X}-n\bar{X}$$ $$=0$$
It looks to me like $\bar{X}$ does not depend on $i$, hence $\sum_{i=1}^n \bar{X} = \bar{X}\sum_{i=1}^n 1 = n\bar{X}$.
As for why $\sum_{i=1}^n X_i = n \bar{X}$, there's not enough information in your post to be able to address that.