Roots of a functionwith condition $\int_0^\pi f(x) \sin x dx = \int_0^\pi f(x) \cos x dx =0.$

Let $f:[0,\pi] \rightarrow \Bbb R$ be a continuous function which satisfies $\int_0^\pi f(x) \sin x dx = \int_0^\pi f(x) \cos x dx =0.$ Show that $f$ has at least two roots.


$$\int_0^\pi f(x)\sin(x)\mathrm dx=0$$ If $f$ has no roots in $(0,\pi)$, then its sign doesn't change on $[0,\pi]$. That means the sign of $f\cdot\sin$ doesn't change on $[0,\pi]$. Since its integral is $0$, it must be $0$ on all of $[0,\pi]$, which means $f=0$. Since this is a contradiction, $f$ must have at least one root in $(0,\pi)$.

Suppose that $f$ has only one root $x_0$.
So the sign of $f$ doesn't change on $(0,x_0)$ and doesn't change in $(x_0,\pi)$. (otherwise, we'd find another root)
If $f$ has the same sign on both intervals, then $f\cdot\sin$ keeps the same sign on $(0,\pi)$, and its integral can't be $0$. So we must necessarily have that the signs are different.

Now consider the function: $g(x)=f(x)\sin(x-x_0)$
This function doesn't change its sign on $(0,\pi)$ and its integral is $0$. (since $\sin(x-x_0)=a\sin(x)+b\cos(x)$) This gives us that $f=0$ which can't be, according to our assumption.

Therefore $f$ must have at least two roots.