Integral-sum conversion in the proof that the $\chi^2$ statistic tends to the $\chi^2$ distribution
Define $Y_{n,i}=(k_i-np_i)/\sqrt{np_i}$ and let $Y_n:=[Y_{n,1} \quad\cdots\quad Y_{n,m}]^{\top}$ such that $\chi_p^2(\{p_i\})=Y_n^{\top}Y_n$. By the CLT (assuming i.i.d. observations), $$ Y_{n}\xrightarrow{d}Y\sim N(0,\Sigma), $$ where $\Sigma=I_m-aa^{\top}$ with $a=[\sqrt{p_1} \quad\cdots\quad \sqrt{p_m}]^{\top}$. Let $Q\Lambda Q^{\top}$ be the eigendecomposition of $\Sigma$, i.e., $\Sigma=Q\Lambda Q^{\top}$ and $QQ^{\top}=I_m$. Then $$ Y^{\top}Y= Y^{\top}QQ^{\top}Y, $$ with $Q^{\top}Y\sim N(0,\Lambda)$. It is not hard to check that $\Lambda=\operatorname{diag}(0,1,\ldots,1)$. Thus, $Y^{\top}Y$ is the sum of squares of $m-1$ independent $N(0,1)$ random variables. Finally, using the continuous mapping theorem, $$ \chi_p^2(\{p_i\})\xrightarrow{d}Y^{\top}Y\sim \chi_{m-1}^2. $$