Why such function does not exist? I could not prove the following: 

A function $f \in \mathscr{C}^2([0, \pi])$, such that $$f(0) = f(\pi) = 0,\\
\int_0^{\pi} (f'(x))^2dx = 1,\\
\text{and }\int_0^{\pi} (f(x))^2dx = 2$$
  Then such function does not exist. 

I think that I have to use the Rayleigh quotient and have a contradiction for the eigenvalue $\frac{1}{2}$. Thanks in advance.

This was meant as a comment to O.L.'s answer, but it was too long:
Here is an array of the four values of $(a,b)$ for $f(x)=(a+bx)x(\pi-x)$ that satisfy the given conditions:
$$
\left(
\begin{array}{cc}
 \frac{\pi ^{5/2} \sqrt{210 \left(-5+\pi ^2\right)}-\sqrt{630 \pi ^5-30 \pi ^7}}{4 \pi
   ^5} , -\frac{\sqrt{\frac{1}{2} \left(-525+105 \pi ^2\right)}}{\pi ^{7/2}} \\[6pt]
 \frac{\pi ^{5/2} \sqrt{210 \left(-5+\pi ^2\right)}+\sqrt{630 \pi ^5-30 \pi ^7}}{4 \pi
   ^5} , -\frac{\sqrt{\frac{1}{2} \left(-525+105 \pi ^2\right)}}{\pi ^{7/2}} \\[6pt]
 \frac{-\pi ^{5/2} \sqrt{210 \left(-5+\pi ^2\right)}-\sqrt{630 \pi ^5-30 \pi ^7}}{4 \pi
   ^5} , \frac{\sqrt{\frac{1}{2} \left(-525+105 \pi ^2\right)}}{\pi ^{7/2}} \\[6pt]
 \frac{-\pi ^{5/2} \sqrt{210 \left(-5+\pi ^2\right)}+\sqrt{630 \pi ^5-30 \pi ^7}}{4 \pi
   ^5} , \frac{\sqrt{\frac{1}{2} \left(-525+105 \pi ^2\right)}}{\pi ^{7/2}}
\end{array}
\right)
$$
