[proofplan]
By the [Least-Squares Approximation Theorem](/theorems/479), the partial sum $s_n$ satisfies $\|f - s_n\|^2 = \|f\|^2 - \sum_{k=0}^n c_k^2\langle p_k, p_k \rangle$. By the [Weierstrass Approximation Theorem](/theorems/480), polynomials are dense in $C[a,b]$ under the $L^\infty$ norm, which controls the $L^2_w$ norm. Since $s_n$ is the best $L^2_w$ approximation in $P_n$, $\|f - s_n\|^2 \to 0$, yielding Parseval's identity.
[/proofplan]
[step:Express the partial-sum error using the least-squares formula]
Let $s_n = \sum_{k=0}^n c_k\,p_k$ be the degree-$n$ least-squares approximation with $c_k = \langle f, p_k \rangle / \langle p_k, p_k \rangle$.
By the [Least-Squares Approximation Theorem](/theorems/479),
\begin{align*}
\|f - s_n\|^2 &= \|f\|^2 - \sum_{k=0}^n \frac{\langle f, p_k \rangle^2}{\langle p_k, p_k \rangle}.
\end{align*}
[/step]
[step:Show $\|f - s_n\|^2 \to 0$ using Weierstrass and optimality of $s_n$]
By the [Weierstrass Approximation Theorem](/theorems/480), for any $\varepsilon > 0$ there exists a polynomial $q$ with $\|f - q\|_{L^\infty} < \varepsilon$.
Since the $L^2_w$ norm is controlled by the $L^\infty$ norm ($\|g\|^2 \le \|g\|_{L^\infty}^2\int_a^b w \, d\mathcal{L}^1$), we have $\|f - q\|^2 \le \varepsilon^2\int_a^b w \, d\mathcal{L}^1$.
Since $s_n$ is the best approximation in $P_n[x]$, $\|f - s_n\|^2 \le \|f - q\|^2$ for $n \ge \deg q$.
Therefore $\|f - s_n\|^2 \to 0$ as $n \to \infty$.
[/step]
[step:Conclude Parseval's identity by taking the limit]
Taking $n \to \infty$ in the least-squares formula:
\begin{align*}
\sum_{k=0}^\infty \frac{\langle f, p_k \rangle^2}{\langle p_k, p_k \rangle} &= \lim_{n \to \infty}\sum_{k=0}^n \frac{\langle f, p_k \rangle^2}{\langle p_k, p_k \rangle} = \|f\|^2.
\end{align*}
[/step]