Let $L^{2}_{\rho}\left ( K \right )=\left \{ complex \space function f \left ( x \right )=g\left ( x \right )+ih\left ( x \right ): f: K\rightarrow \mathbb{C}, \int_{a}^{b}\left | f\left ( x \right )^{2}\right |\rho\left ( x \right ) .dx < \infty\right \}$.
Now, the above set is a separable infinite dimensional Hilbert space H. By separable, $L^{2}_{\rho}$ has a countably infinite subset $S=\left \{ \phi_{1}\left ( x \right ),\cdot \cdot \cdot \right \}$ so every complex function in $L^{2}_{\rho}$ can be expressed as a linear combination of elements in S.
How do I see that S is an orthonormal basis for $L^{2}_{\rho}$?
You take arbitrary basis of $L_\rho^2(K)$, then it could be, that it isn't orthonormal. Since it is countable, you can make the basis orthonormal, using the Gram-Schmidt process . And therefore you can assume w.l.o.g. that $S$ is orthonormal.