Let $f$ be a continuous function on closed interval $[0,1]$. Prove that if $n$ is a positive integer and $\int_{0}^{1}x^{k}f(x)\text{d}x=0$ for all $k=0,1,...,n$ then $f$ has $n+1$ different zeros on $[0,1]$.
I got $\int_{0}^{1}P(x)f(x)\text{d}x=0$ for all polynomial $P(x)$ of degree less or equal than $n$. Assume for a contradiction that $f(x)$ has $n$ distinct zeros $a_{1},...,a_{n}$ (or fewer), then I want to construct a polynomial $P(x)$ such that $P(x)f(x)\geq 0$ for all $x\in [0,1]$. Maybe $P(x)$ should be constructed based on the zeros of $f$, but I'm stuck. Can anybody provide me a hint? Thanks