So given $\Psi(x,t_0) = \Sigma_n a_n \psi_n(x)$ we multiply both sides by $\psi_m(x)$ and integrate and sum over all $m$ to get: $a_m = \int_{-\infty}^{\infty}\Psi(x,t_0)\psi_m(x)dx$
Sorry, it's explained wrong. We multiply both sides by $\psi_m(x)$ and integrate. The sum on the right will pick out exactly the case where $n=m$ and so there is no additional summing over $m$. The final answer is correct though. $a_m = \int_{-\infty}^{\infty}\Psi(x,t_0)\psi_m(x)dx$