Is $f$ that satisfies $\int_a^bf(x)dx=\int_a^bxf(x)dx=\int_a^bx^2f(x)dx=0$ a constant? My question is:
Define $f\in C^{0}[a,b]$ satisfying $\int_a^bf(x)dx=\int_a^bxf(x)dx=\int_a^bx^2f(x)dx=0$. Must this function be a constant function?
I made a easy analysis, which can prove that $f$ has at least three points, as follows

we have $\int_{a}^{b}g(x)f\left(x\right)dx=0$ , in which $g(x)=mx^2+nx+p$. $\forall m,n,p \in \mathbb{R}$
If $f$ has less than three zero points, we can select appropriate $m$,$n$,$p$ satisfying  $g(x)f(x)>0$ for all $x$ which is not the zero point of $f$. And it's contradictory to $\int_{a}^{b}g(x)f\left(x\right)dx=0$. Thus $f$ must have at least three zero points.

So can we make a further analysis that indicates $f$ is a constant function?Any ideas would be highly appreciated!
 A: The constraints on $f$ only mean that $f$ is orthogonal to the vector space of polynomials of degree less than 2. But there do exist loads of functions who are not constants and satisfy this conditions.
Take a look at the Gram Schmidt orthonormalisation procedure and try to find a polynomial (for example of degree 3) orthogonal to the polynomials $1$, $x$ and $x^2$.
A: $f$ is not necessarily constant. To see this, note that the vector space $C^0[a,b]$ has infinite dimension, and 
$$ f \mapsto \left (\int_a^b f(x)dx, \int_a^b x f(x)dx, \int_a^b x^2 f(x)dx\right) $$
is a linear transformation $C^0[a,b] \to \mathbb R^3$. Since the domain has larger dimension than the codomain, the kernel of the transformation (that is, the set of all functions for which all three integrals are zero) must be nontrivial.
(So there's a qualifying $f$ that is not the zero function, which means that it is not constant, because the first integral for a nonzero constant function would not be $0$).
A: No. WLOG $a=-1$ and $b=1$ (otherwise rescale). Then let $f$ be a Legendre polynomial of degree $\ge 3$.
A: To construct a counter-example, take $[a,b]=[0,1]$ and consider a cubic polynomial
$$f(x)=x^3+cx^2+dx+e$$
Then:
$$\int_0^1 f(x)dx=\frac14+\frac{c}{3}+\frac{d}{2}+e=0$$
$$\int_0^1 xf(x)dx=\frac15+\frac{c}{4}+\frac{d}{3}+\frac{e}{2}=0$$
$$\int_0^1 x^2f(x)dx=\frac16+\frac{c}{5}+\frac{d}{4}+\frac{e}{3}=0$$
We have three equations in three unknowns, so we can hope for a solution. And indeed if we do the algebra (or have Wolfram Alpha do it for us), we get $(c,d,e)=(-\frac32,\frac35,-\frac{1}{20})$. Multiplying by $20$ to get rid of the fractions gives
$$f(x)=20x^3-30x^2+12x-1$$
