Nonzero $f \in C([0, 1])$ for which $\int_0^1 f(x)x^n dx = 0$ for all $n$
I found a nice problem I would like to share.
Problem: If $f$ is continuous on $[0,1]$, and if
$$\int_0^1 f(x)x^n \ dx =0$$
for every positive integer $n$, prove that $f(x)=0$ on $[0,1]$.
Source: W. Rudin, Principles of Mathematical Analysis, Chapter 7, Exercise 20.
I have posted a proposed solution in the answers.