Prove that $ f(x) $ has at least two real roots in $ (0,\pi) $ Let $ f $ be a continuous function defined on $ [0,\pi] $. Suppose that 

$$ \int_{0}^{\pi}f(x)\sin {x} dx=0,   \int_{0}^{\pi}f(x)\cos {x} dx=0 $$

Prove that $ f(x) $ has at least two real roots in $ (0,\pi) $
 A: If f has only one real root on $ (0,\pi)$, say $ a \in (0,\pi) $, then define 
$ g(x) = f(x) \sin(x-a) = f(x) (\sin(x)\cos(a) - \cos(x)\sin(a))$, then $ g(x) $ is either non-positive or non-negative, not identically zero, and has integral $ 0 $. Contradiction. 
A: Since another question has been closed and linked to here, I figure it would be good to make sure there's an answer here that compiles everything nicely.

First, we show that $f$ has at least one root, as in Lior B-S's answer.
Let $F(x) = \int_{0}^x f(t) \sin(t)\, dt$.
Then $F(0)=0$, and by hypothesis $F(\pi)=0$ too.
It follows from the intermediate value theorem that there is some $c \in (0,\pi)$ with
$$0=F'(c) = f(c)\sin c.$$ 
Because $\sin$ has no zeroes in $(0,\pi)$, we obtain that $f(c)=0$.

We now show that $f$ must have more than one root, by contradiction.
This is in line with Lev's answer and the addtitional explanantions in the comments under it.
Suppose that $f$ has the single root at $c$;
there are two possibilities:


*

*$f$ does not change signs at the root $c$.


In this case, because the sine also does not change signs on $(0,\pi)$, we'd have that $f(x)\sin(x)$ does not change signs on $(0,\pi)$.
This implies that for $x\in(0,\pi)$, $f(x)\sin(x) = 0$ only at $x=c$, and it has the same sign everywhere else, in contradiction with $\int_0^\pi f(t)\sin(t)\,dt =0$.


*

*$f$ changes signs at the root $c$.


In this case, consider
$$g(x) = f(x)\cdot \sin(x-c) = f(x) \Big(\sin(x)\cos(c) - \cos(x)\sin(c)\Big).$$
Notice that
$$\int_0^\pi g(t)\,dt =
\cos(c)\underbrace{\int_0^\pi f(t)\sin(t)\,dt}_0 -
\sin(c)\underbrace{\int_0^\pi f(t)\cos(t)\,dt}_0 = 0.$$
However, $\sin(x-c)$ changes sign exactly once for $x\in(0,\pi)$, on $x=c$.
This implies that for $x\in(0,\pi)$, $g(x) = 0$ only at $x=c$, and it has the same sign everywhere else, in contradiction with $\int_0^\pi g(t)\,dt =0$.

Regardless of the situation, we see that the assumption that $f$ has a single root at $c$ leads to a contradiction, so we  conclude that $f$ must have more than one root, as desired.
Moreover, as per James Fennell's comment under the question, $f(x)=\sin(3x)$ satisfies the conditions in the statement and has exactly $2$ roots in $(0,\pi)$, so 'at least two roots in $(0,\pi)$' is tight.
A: Here is one root: 
Let $F(x) = \int_{0}^x f(t) \sin t dt$. Then $F(0)=0$ and $F(\pi)=\int_{0}^\pi f(t)\sin tdt=0$. So by the intermediate value theorem, there exists $0<c<\pi$ such that
$$
0=F'(c) = f(c)\sin c.
$$
But since $\sin c\neq 0$, we get that $f(c)=0$.
A: This statement is not true. Actually, we should prove that $$\int_0^\pi f(x)[\cos x-\sin x]dx=0$$Now, define $$f(x)=\begin{cases}a\left(e-e^{4x\over \pi}\right)+1&,\quad 0\le x\le {\pi\over 4}\\1&,\quad {\pi\over 4}<x\le \pi\end{cases}$$where $a\ge 0$. It is clear that $f(x)\ge 1$ over $[0,\pi]$ for all $a\ge 0$ hence it has no root. However, by defining $$I=\int_0^\pi f(x)[\cos x-\sin x]dx$$we immediately conclude that $I=-2<0$ for $a=0$ and $\lim_{a\to \infty } I=\infty$. Based on intermediate value theorem and since $I$ is continuous w.r.t. $a$, there is a value for $a$ for which $I=0$, hence the statement is not true.
Here is a sketch of the two functions using Python:

A: This is a problem of complex calculus.
The linear combination of both given integral can be used to represent a path. The function $f$ can be rewritten with the path inside. This is  possible because $f$ depends on one real variable.
The path can be interpreted as the upper half circle above the real axis in the complex plane.
Look at for example: Line integral.
Now just given the pair of identies allows us the combine with $i$ and $-i$. The path can be run clockwise and counterclockwise.
If $F$ is the function $f$ on the complex path over the upper half of the unit circle. With $F$ is the $\overline F$ a solution. This gives without the complexes the existence of two solutions for $f$.
The steadiness of $f$ is needed to the exitence of the integrals. This does not follow from the identities. A function that is steady has an integral. Functions that are steady have integrals multiplied with transcendent functions. These are in the class of steady functions too. This attribut hat to be given in the interval $[0,\pi]$.
If the identities were not given alone the solution will not be double.
I am the opinion it is better practice to be more precise on the question regarding for $x$. The question is hard because it has not contexts. There is reason to mark this duplicate. Now that a correct answer/proof is given the situation changes.
