A useful way to check this without memorizing the formula outright is to look at what each option is actually built from and match it against what a 'goodness of fit' statistic needs to do. A goodness-of-fit measure needs to compare each individual observed value to its own corresponding expected value, for every one of the $n$ categories, and it needs to penalize larger mismatches more heavily (via squaring) while accounting for scale (by dividing by the expected value).
Option (B) only uses the observed values and their overall mean $\bar{O}$, never touching $E_i$ at all, so it cannot be measuring agreement between observed and expected data; it is structurally the sample standard deviation formula. Option (C) compares $\bar{O}$ to $\mu$, losing all the per-category detail. Option (D) reduces everything to a ratio of two whole-dataset variances, describing the test statistic used to compare two variances (the F-test).
Only the summation form $\sum_{i=1}^n \frac{(O_i-E_i)^2}{E_i}$ preserves the per-category comparison that the Chi-Square test is built on.
\[\boxed{\chi^2 = \sum_{i=1}^{n}\frac{(O_i-E_i)^2}{E_i}}\]