The $\chi^2$ goodness-of-fit test uses the following statistic: $$ \chi_0^2=\sum_{i=1}^n\frac{(O_i-E_i)^2}{E_i} $$ In the test, granting that the conditions are met, one uses the $\chi^2$-distribution to calculate the p-value that given the $H_0$ is true one would observe such a value in a representative sample of the same size.
However, in order for a statistic $\chi_0^2$ to follow a $\chi^2$-distribution (with $n-1$ degrees of freedom), it must be true that: $$ \sum_{i=1}^n\frac{(O_i-E_i)^2}{E_i}=\sum_{i=1}^{n-1}Z_i^2 $$ for independent, standard normal $Z_i$ (Wikipedia). The conditions for the test are as follows (again, from Wikipedia):
- Sample representative of population
- Large sample size
- Expected cell count is sufficiently large
- Independence between each category
From conditions (1,2) it is clear that we satisfy conditions for inference from the sample to the population. (3) seems to be an assumption required because the discrete count $E_i$, which is in the denominator, does not result in a near-continuous distribution for each $Z_i$ and if it is not large enough there is an error that can be corrected with Yates' correction - this seems to be from the fact that a discrete distribution is basically a "floored" continuous one, so the shift by $1/2$ for each one corrects this.
The necessity of (4) seems to come in handy later, but I cannot see how.
At first, I thought that $Z_i=\frac{O_i-E_i}{\sqrt{E_i}}$ is necessary for the statistic to match the distribution. This lead me to the questionable assumption that $O_i-E_i\sim \mathcal{N}(0, \sqrt{E_i})$, which was indeed wrong. In fact, it is clear from the reduction of dimension for two sides of the equality from $n$ to $n-1$ that this cannot be the case.
It has become apparent, thanks to whuber's explanations, that $Z_i$ need not equal each $\frac{O_i-E_i}{\sqrt{E_i}}$ term because $\chi_0^2=\sum_{i=1}^{n-1}Z_i^2$ (note the reduction in the number of summed variables) for standard normal random variables $Z_i$ which are functionally independent.
My question, then, is how can $\chi_0^2$ follow the $\chi^2$ distribution? What kinds of combinations of each of the $\frac{(O_i-E_i)^2}{E_i}$ terms result in squared standard normals $Z_i^2$? This requires the use of the CLT, apparently (and that makes sense), but how? In other words, what is each $Z_i$ equal to (or approximately equal to)?