$\int_0^1f(x) dx =0$, $\int_0^1xf(x) dx =0$. How to show that f has at least two zeros?

$\newcommand{\d}[1]{\, \mathrm{d} #1}$ Define: $$ F(x) = \int_0^x f(t) \d{t} $$ Then we observe that $F(0) = F(1) = 0$, and: $$ \int_0^1 F(x) \d{x} = \left[xF(x)\right]_{x=0}^{x=1} - \int_0^1 xf(x)\d{x} = 0 $$ Then, as you mentioned above, we have $c \in (0,1)$ such that $F(c) = 0$. We can now apply Mean Value Theorem, where there exist $c_1 \in (0,c)$ and $c_2 \in (c,1)$ such that $F'(c_1) = F'(c_2) = 0$. Since $F'(x) = f(x)$, $c_1$ and $c_2$ are two distinct zeroes of $f$.


The given constraints ensure $\int_{0}^{1}(x-k)f(x)\,dx = 0$ for any k.
So, let us assume that $f(x)$ has a unique zero at $x_0\in(0,1)$. Up to replacing $f$ with $-f$, we may as well assume that $f(x)<0$ over $[0,x_0)$ and $f(x)>0$ over $(x_0,1]$. In such a case both $$ \int_{0}^{x_0}(x-x_0)f(x)\,dx\qquad \text{and}\qquad \int_{x_0}^{1}(x-x_0)f(x)\,dx $$ are positive, hence their sum $\int_{0}^{1}(x-x_0)f(x)\,dx$ cannot be zero, contradiction.

It is worth mentioning that this gives a rather powerful criterion for root detection, which is the core of the celebrated result of Conrey, giving the $40\%$ of RH: if for some non-negative weight function $\omega(x)$ all the moments $$ M_k = \int_{0}^{1}x^k f(x)\omega(x)\,dx $$ are (approximately) zero up to $k=n$, then $f(x)$ has at least $n$ zeroes in $[0,1]$.