I'm not entirely sure I'm reading your query correctly; I'll edit this if my interpretation's off the mark.
You're asking how the Stieltjes procedure for generating orthogonal polynomials with respect to some given weight $w(x)$ works. It's a bootstrapping procedure. You usually start with the first two known members, and slowly build up the other members through inner product computations and recursion.
Again, take
$$(f(x),g(x))=\int_a^b w(u)f(u)g(u) \,\mathrm du$$
and let $\phi_k(x)=A_k x^k+\cdots$ be the degree-$k$ polynomial that is orthogonal with respect to the weight function $w(x)$, i.e.
$$(\phi_k(x),\phi_\ell(x))=0,\quad k\neq \ell$$
Consider first
$$q(x)=\phi_{k+1}(x)-\frac{A_{k+1}}{A_k}x\phi_k(x)$$
which is a linear combination precisely designed to have a missing $x^{k+1}$ term.
This can be expanded as a series of orthogonal polynomials of degree $k$ and lower (abbreviating $\frac{A_{k+1}}{A_k}$ as $a_k$):
$$\phi_{k+1}(x)-a_k x\phi_k(x)=\mu_k\phi_k(x)+\mu_{k-1}\phi_{k-1}(x)+\cdots$$
where the $\mu_j$ are given by
$$\mu_j=\frac{(q(x),\phi_j(x))}{(\phi_j(x),\phi_j(x))}$$
Another fact we are going to need is
$$(\phi_k(x),x^\ell)=0,\quad \ell < k$$
We find from these considerations that the coefficients $\mu_j$ for $j < k-1$ vanish. Thus, after renaming $\mu_k$ to $b_k$ and $\mu_{k-1}$ to $c_k$, we have
$$\phi_{k+1}(x)-a_k x\phi_k(x)=b_k\phi_k(x)+c_k\phi_{k-1}(x)$$
At this point, it should be noted that one convenient normalization is to have the $\phi_k(x)$ be monic ($A_k=1$); this means we can set $a_k=1$ and consider the three-term recursion
$$\phi_{k+1}(x)=(x+b_k)\phi_k(x)+c_k\phi_{k-1}(x)$$
If we take inner products of both sides with $\phi_{k+1}(x)$, $\phi_k(x)$, and $\phi_{k-1}(x)$ in turns, we have the system
$$\begin{align*}(\phi_{k+1}(x),\phi_{k+1}(x))&=(\phi_{k+1}(x),x\phi_k(x))\\0&=(x\phi_k(x),\phi_k(x))+b_k(\phi_k(x),\phi_k(x))\\0&=(x\phi_k(x),\phi_{k-1}(x))+c_k(\phi_{k-1}(x),\phi_{k-1}(x))\end{align*}$$
where we've exploited linearity of the inner product and the orthogonality relation.
Solving for $b_k$ and $c_k$ in the last two equations, we have
$$\begin{align*}b_k&=-\frac{(x\phi_k(x),\phi_k(x))}{(\phi_k(x),\phi_k(x))}\\c_k&=-\frac{(x\phi_k(x),\phi_{k-1}(x))}{(\phi_{k-1}(x),\phi_{k-1}(x))}\end{align*}$$
$c_k$ can be expressed in a different way, using the fact that $(x\phi_k(x),\phi_{k-1}(x))=(\phi_k(x),x\phi_{k-1}(x))$ and shifting the index $k$ in the equation for $(\phi_{k+1}(x),\phi_{k+1}(x))$, yielding
$$c_k=-\frac{(\phi_k(x),\phi_k(x))}{(\phi_{k-1}(x),\phi_{k-1}(x))}$$
It's been all theoretical at this point; let me demonstrate the Stieltjes procedure with the monic Chebyshev polynomials (of the first kind) as a concrete example. The associated inner product is
$$(f(x),g(x))=\int_{-1}^1 \frac{f(u)g(u)}{\sqrt{1-u^2}}\mathrm du$$
The usual way of proceeding starts with $\phi_{-1}(x)=0$ and $\phi_0(x)=1$. To find $\phi_1(x)$, we compute
$$b_0=-\frac{(x,1)}{(1,1)}=0$$
and thus $\phi_1(x)=x$. To get $\phi_2(x)$, we compute
$$\begin{align*}b_1&=-\frac{(x\phi_1(x),\phi_1(x))}{(\phi_1(x),\phi_1(x))}=0\\c_1&=-\frac{(\phi_1(x),\phi_1(x))}{(\phi_0(x),\phi_0(x))}=-\frac12\end{align*}$$
and thus $\phi_2(x)=\left(x+b_1\right)\phi_1(x)+c_1\phi_0(x)=x^2-\frac12$. Clearly we can continue this bootstrapping, generating $\phi_3(x),\phi_4(x),\dots$ in turn by computing inner products and recursing. (As it turns out, for this example all the $b_k$ are zero.)
Best Answer
A proof uses linear algebra. Orthogonality implies the polynomials in a basis are linearly independent. To see this more clearly, the inner product of a finite sum of orthogonal polynomials $\sum_{k=0}^m a_k p_k$ and a $p_i$ where $0 \leq i \leq m$ is a $c a_i$ for a constant $c$.