Lebesgue integration calculation problem? 
Let $f:[0,1]\to \Bbb R$ be a bounded, Lebesgue measurable function with satisfies $$\int_{[0,1]}f(x)x^kdx=\frac{1}{(k+2)(k+3)}=\frac{1}{k+2}-\frac{1}{k+3} $$ for each $k\in \Bbb N \cup{0}$. Show that $f(x)=x-x^2$ almost everywhere(with respect to Lebesgue measure) on $[0,1]$.

This problem looks obvious by calculus. I don't know where to start. I cannot thinks a theorem in Lebesgue integration I can use. Could someone kindly provide a hint? Thanks!
 A: We can relax the boundedness assumption. Suppose $f\in L^1(0,1)$ and the integral condition holds for all $k=0,1,\dots $ Let $g(x) = f(x)-(x-x^2).$ Then $\int_0^1g(x)x^k\,dx = 0$ for all $k.$ Hence $\int_0^1g\cdot p = 0$ for all polynomials $p.$
If $h$ is continuous on $[0,1],$ then by Weierstrass there is a sequence of polynomials $p_n \to h$ uniformly. A simple DCT argument then shows $\int_0^1g\cdot h = 0.$
Define $s(x) = x/|x|, x \ne 0,s(0) = 0.$ Then $s(g(x))$ is bounded and measurable on $[0,1].$ Hence by a well-known corollary of Lusin's theorem, there is a sequence $h_n\in C([0,1]), |h_n(x)|\le 1$ for $x\in [0,1],$ such that $h_n(x) \to s(g(x))$ a.e. By the DCT, we get
$$\int_0^1|g| = \int_0^1 g\cdot s(g) = \lim_{n\to \infty}\int_0^1g\cdot h_n =0.$$
Thus $g=0$ a.e.
A: If we set $g(x)=f(x)-\left(x-x^2\right)$ we have that $g(x)$ is a measurable and bounded function for which:
$$\forall k\in\mathbb{N},\qquad \int_{0}^{1} g(x)\,x^k\,dx = 0.\tag{1}$$
The previous line implies:
$$\forall n\in\mathbb{N},\qquad \int_{0}^{1} g(x)\,P_n(2x-1)\,dx = 0,\tag{2}$$
where $P_n(2x-1)$ is the $n$-th shifted Legendre polynomial. 
Since the shifted Legendre polynomials are an orthogonal base of $L^2(0,1)$ with respect to the standard inner product $\langle u,v\rangle = \int_{0}^{1}u(x)v(x)\,dx$, by exploiting Parseval's identity and $(2)$ we get:
$$ \int_{0}^{1}g(x)^2\,dx = 0, \tag{3}$$
from which $g\equiv 0$ almost everywhere. 
A: It is easy to prove. We know that if $\int_A (f-g)d\mu=0$ then $f=g\hspace 3mm a.e. on A$ then we have to prove that
$$\int_{[0,1]}(f(x)-(x-x^2))x^kdx=0$$
 But we have
$$\int_{[0,1]}((x-x^2)x^k)dx=\frac{1}{k+2}-\frac{1}{k+3}$$
So the problem is solved.
