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!
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.
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.