Proof that Legendre Polynomials are Complete
We follow J. Weidmanns Linear Operators in Hilbert Spaces. We find in section $3.2$ Orthonormal systems and orthonormal bases:
Example 6: In $L_2(-1,1)$ the set $F=\{f_n:n\in \mathbb{N}_0\}$ with $f_n(x)=x^n$ is a linearly independent system.
The application of the Gram-Schmidt orthogonalization process provides an orthonormal system (ONS) $M=\{p_n:n\in\mathbb{N}_0\}$, where $p_n(x)=\sum_{j=0}^na_{n,j}x^j$ holds with $a_{n,n}>0$; i.e., $p_n$ is a polynomial of degree $n$ with a positive leading coefficient.
These polynomials are called the Legendre polynomials. As $F$ is total, the Legendre polynomials constitute an orthonormal basis (ONB) in $L_2(-1,1)$.
The polynomials $p_n$ can be given explicitly: \begin{align*} p_n(x)=\frac{1}{2^nn!}\left(\frac{2n+1}{2}\right)^{\frac{1}{2}}\frac{d^n}{dx^n}\left(x^2-1\right)^n,\qquad\qquad n\in\mathbb{N}_0\tag{1} \end{align*}
$L_2(M)$ denotes a Lebesgue space for a Lebesgue measurable subset $M$ of $\mathbb{R}^m$. If $B$ is a subset of a Hilbert space $H$, then it is said to be total if the linear hull $L(B)$ (the set of finite linear combinations of elements of $B$) is dense in $H$, i.e. ${\overline{L(B)}}=H$.
In order to prove formula (1) it is sufficient to show that the expression given for $p_n$ is a polynomial of degree $n$ whose leading coefficient is positive and that $\langle p_n,p_m\rangle=\delta_{n,m}$.
The first assertion is obvious. For $j<m$ we obtain by a $(j+1)$-fold integration by parts (the integrated terms vanish) that \begin{align*} \int_{-1}^1x^jp_m(x)\,dx&=C_m\int_{-1}^1x^j\frac{d^m}{dx^m}\left(x^2-1\right)^m\,dx\\ &=\ldots\\ &=C_m(-1)^{j+1}\int_{-1}^1\frac{d^{j+1}}{dx^{j+1}}(x^j)\frac{d^{m-j-1}}{dx^{m-j-1}}\left(x^2-1\right)^m\,dx\\ &=0 \end{align*} This implies that $\langle p_n,p_m\rangle=0$ for $n\ne m$. It remains to prove that $\|p_n\|=1$. By integration by parts we obtain that \begin{align*} \int_{-1}^1&\left[\frac{d^n}{dx^n}\left(x^2-1\right)^n\right]^2\,dx\\ &=(-1)^n\int_{-1}^1\left(x^2-1\right)^n\frac{d^{2n}}{dx^{2n}}\left(x^2-1\right)^n\,dx\\ &=(2n)!\int_{-1}^1(1-x)^n(1+x)^n\,dx\\ &=(2n)!\frac{n}{n+1}\int_{-1}^1(1-x)^{n-1}(1+x)^{n+1}\,dx\\ &=(2n)!\frac{n(n-1)}{(n+1)(n+2)}\int_{-1}^1(1-x)^{n-2}(1+x)^{n+2}\,dx\\ &=\ldots\\ &=(2n)!\frac{n(n-1)\cdots 1}{(n+1)(n+2)\cdots 2n}\int_{-1}^1(1+x)^{2n}\,dx\\ &=(2n)!\frac{1}{2n+1}\left[(1+x)^{2n+1}\right]_{-1}^1\\ &=(n!)^2(2n+1)^{-1}2^{2n+1} \end{align*}
From this it follows that $\|p_n\|=1$ and the Legendre polynomials constitute an ONB in $L_2(-1,1)$.
I think that B_Scheiner's answer could be condensed to the statement that it depends on it being of Sturm–Liouville type.
Once you have a linear inner product and resolution of the identity, then $$\begin{align}f(x) &= \int\!dx'\, \delta(x-x') f(x')\\ & = \int\!dx'\, \left[ \sum_{n} u_n(x) u_n(x') w(x) \right] f(x')\\ & = \sum_n u_n(x) \left[\int\!dx'\, u_n(x') w(x) f(x') \right]\\ & = \sum_n u_n(x) f_n \end{align}$$
Thus all you really need to do is prove that the set of all Legendre polynomials satisfies $\sum_n p_n(x) p_n(y) = \delta(x-y)$ over the domain.
This properly belongs in math.se though, but I suppose it's something every physicist should know.
Let $M_n = \int_a^b |f(x)-\sum_i a_i f_i(x)|^2 dx$ where $f_i$ is an orthonormal set of functions (such as the legendre polynomials). The set of $ f_i$ is complete if there is a set of coefficients $\{a_i\}$ such that $\lim_{n -> \infty} M_n=0$. If you can show that you can approximate a function on a closed interval in a way such that $M_n$ goes to zero as n goes to infinity then you are golden ( maybe look into the wierstrass approximation theorem).
I should mention that the legendre polynomials are part of what are termed Sturm -Louiville problems, and your question could be generalized to a much larger set of polynomials.