TITLE: Show that a continuous function with a certain integral property must be f(x)=x.
QUESTION [5 upvotes]: I am studying for the quals in January and am working through the following problem:

Let $f:[0,1] \to [0,1]$ be a continuous function with the property
  that $\displaystyle\int_0^1 f(x)x^n \, \textrm{d}x = \dfrac{1}{n+2}$.
  Show that $f(x)\equiv x$.

I was thinking to do integration by parts, but this does not seem to yield anything. Any suggestions would be much appreciated!

REPLY [6 votes]: Consider $g(x)=f(x) -x$, then
$$
\int g(x)p(x)dx = 0
$$
for every polynomial $p$. Now by Weierstrass Approximation, and the continuity of the integral, it follows that
$$
\int g^2(x)dx = 0
$$
Since $g$ is continuous, it follows that $g \equiv 0$.

REPLY [3 votes]: I would say,
(a) Prove it for $f$ polynomial.
(b) use Stone-Weierstrass to approximate by polynomials, and then use (a) to show that the coefficients other than the linear term are arbitrarily small.

REPLY [2 votes]: Perhaps this helps...
$$(n+2)\int_0^1f(x)x^ndx=1$$
Then $$\int_0^1(n+2)f(x)x^ndx=1$$
You can see the power rule embedded in there now, except $x^n$ would need to be $x^{n+1}$.  So what must $f(x)$ be?