Proof (Gaussian quadrature)
Exact on $\mathcal{P}_{2n+1}$ $\implies$ nodes at roots of $Q_{n+1}$
Let $\int_{a}^{b} f(x)ω(x) \d x\approx \sum_{i=0}^{n} a_i f(x_i)$ be exact on $\mathcal{P}_{2n+1}$. We will show that $\hat Q_{n+1}(x) = \prod_{i=0}^{n} (x-x_i)\in \mathcal{P}_{n+1}$ is the $(n+1)$-th monic orthogonal polynomial, and then the result follows from the uniqueness of monic orthogonal polynomials.
For any $q\in \mathcal{P}_n$, since $\hat Q_{n+1}\cdot q\in \mathcal{P}_{2n+1}$, $$ \begin{align*} \langle \hat Q_{n+1}, q\rangle_w = \int_{a}^{b} \hat Q_{n+1}(x)\,q(x)\,ω(x) \d x = \sum_{i=0}^{n} a_i\,\underbrace{\hat Q_{n+1}(x_i)}_{0}\,q(x_i) = 0. \end{align*} $$
Nodes at roots of $Q_{n+1}$ $\implies$ exact on $\mathcal{P}_{2n+1}$
Let $x_i$ be the roots of $Q_{n+1}$. For any $p\in \mathcal{P}_{2n+1}$, apply the division algorithm to get $$ \begin{align*} p = Q_{n+1}\cdot q + r \end{align*} $$ where $q,r\in \mathcal{P}_n$.
Notice since $Q_{n+1}$ is orthogonal to $\mathcal{P}_n$, $$ \begin{align*} \int_{a}^{b} Q_{n+1}qω \d x =\langle Q_{n+1}, q\rangle = 0. \end{align*} $$ Moreover since the quadrature $\int_{a}^{b} fω \d x \approx \sum_{i=0}^{n} a_i f(x_i)$ is exact on $\mathcal{P}_n$, $$ \begin{align*} \int_{a}^{b} rω \d x = \sum_{i=0}^{n} a_i r(x_i). \end{align*} $$ Also $$ \begin{align*} p(x_i) = \underbrace{Q_{n+1}(x_i)}_{0} \, q(x_{i}) + r(x_i) = r(x_i). \end{align*} $$
Combining these, we get $$ \begin{align*} \int_{a}^{b} pω \d x = \int_{a}^{b} Q_{n+1}qω \d x + \int_{a}^{b} rω \d x = 0 + \sum_{i=0}^{n} a_i r(x_i) = \sum_{i=0}^{n} a_i p(x_i). \end{align*} $$