I wonder how the LHS equation changes to the RHS, because I think there should be no "n" in the denominator on the LHS, so why on the RHS there will be a variance in the numerator?
2 Answers
If the variance estimate is biased (e.g. MLE), then $$\hat\sigma^2=\frac{1}{n}\sum_{i=1}^n (x_i-\hat\mu)^2$$
If you substitute this into your equation, you get the RHS.
Your formula is wrong: $$\hat{\sigma}^2 = \frac{1}{n-1}\sum_{i=1}^n (x_i-\hat{\mu})^2 \quad\Rightarrow\quad\sum_{i=1}^n(x_i-\hat{\mu})^2 = (n-1)\hat{\sigma}^2$$ and not $n\hat{\sigma}^2$. Of course, this depends on the estimator used for $\sigma^2$, but usually the unbiased estimator is used ($n-1$ in the denominator, not $n$).