HINT: integrate by parts with an antiderivative of $f$. Can you find roots of this antiderivative? Can you then conclude something about the stationary points of this antiderivative? The mean value theorem idea is good, it just isn't strong enough (I don't think?) to use on $f$ alone.
$\newcommand{\d}{\,\mathrm{d}}$We are given a nondegenerate compact interval $[a,b]\subset\Bbb R$ and a continuous $f:[a,b]\to\Bbb R$ satisfying: $$\int_a^b f(x)\d x=0=\int_a^b xf(x)\d x$$
Define $F:[a,b]\to\Bbb R$, $x\mapsto\int_a^x f(t)\d t$.
We have $F(b)=0=F(a)$. Integrating by parts: $$0=\int_a^b xf(x)\d x=bF(b)-aF(a)-\int_a^bF(x)\cdot(1)\d x\\therefore\int_a^bF(x)\d x=0$$
Since $F$ is continuous, it follows that there exists a root $\xi\in(a,b)$ of $F$.
$F(a)=F(\xi)=F(b)=0$ implies by Rolle's theorem (and differentiability of $F$) that $F$ has at least two stationary points, one between $a$ and $\xi$, the other inbetween $\xi$ and $b$.
Stationary points of $F$ are exactly roots of $f$, since $F'=f$ on $(a,b)$.