Proof (inner product space is separable iff has orthonormal basis)
Orthonormal basis $\implies$ separable
If $X$ has an orthonormal basis $e_1, e_2,\ldots$, then $$ \begin{align*} \sb{\sum_{i=1}^{n} q_i e_i}{n\in \N, q_1, \ldots, q_n\in \Q} \end{align*} $$ is a countable dense set.
Separable $\implies$ orthonormal basis
Let $\set{x_1, x_2, \ldots}$ be a countable dense subset of $X$.
By throwing out $x_n$ if $x_n\in \op{span}\set{x_1, \ldots, x_{n-1}}$, we obtain a linearly independent subsequence $y_1, y_2, \ldots$ satisfying $\op{span}\set{y_1, y_2, \ldots} \supseteq \set{x_1, x_2, \ldots}$. Then $\overline{\op{span}}\set{y_1,y_2, \ldots} \supseteq \overline{\set{x_1, x_2,\ldots}} = X$ so $\op{span}\set{y_1, y_2, \ldots}$ is dense in $X$.
Perform the Gram-Schmidt process to obtain an orthonormal sequence $e_1, e_2, \ldots$ that satisfies $\op{span}\set{e_1, \ldots, e_n} = \op{span}\set{y_1, \ldots, y_n}$ for all $n\in \N$. Then $\op{span}\set{e_1, e_2, \ldots} = \op{span}\set{y_1, y_2, \ldots}$ is dense in $X$, and hence $e_1, e_2, \ldots$ is an orthonormal basis of $X$.