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.
 A: It does exist. For example,
$$f(x)=a x(\pi-x)+bx^2(\pi-x)$$
with $a\approx-0.718151$, $b\approx 0.290939$ (exact values are too long to type but can be found easily).
Another example:
$$f(x)=2\sqrt{\frac{2}{\pi}} \sin^2x-\frac{32\sqrt{2}+\sqrt{2048-144\pi^2}}{6\pi^{3/2}}\sin x.$$
Maybe you have forgotten to mention some further condition on $f$.
A: 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)
$$
A: I think for user40276 mentioned the Rayleigh quotient, he meant to prove that 

There does not exist such $f\in C^2$ solving the Dirichlet eigenvalue problem for 
  $$-\Delta f= -f''= \lambda f\tag{1}$$ on the interval satisfying those conditions.

Notice the condition means that the $f$ is an eigenfunction of $-\Delta$ with eigenvalue $2$. All the eigenfunction have the form 
$$v(x) = A\sin(\sqrt{\lambda}x) + B\cos(\sqrt{\lambda}x)$$
which solves problem (1). Now for the boundary condition:
$$
v(0) =0 \implies B=0,
$$
so $v(x) = A\sin(\sqrt{\lambda}x)$, now apply the other boundary condition:
$$
v(\pi) =0 \implies A\sin(\sqrt{\lambda}\pi) = 0\implies \sqrt{\lambda} = k\in \mathbb{Z}.
$$
This says that the eigenvalue for problem (1) can only be complete squares, $1,4,9,\ldots$. Hence $2$ can not be one.

UPDATE: OP updated that the eigenvalue problem should be 
$$f' + \lambda f = 0,\tag{2}$$
then the first integration condition is
$$
\int_0^{\pi} \big(f'(x)\big)^2dx = \int_0^{\pi} \big(\lambda f(x)\big)^2dx= 2,
$$
together with the second it implies $\lambda = \pm\sqrt{2}$. The solution to $(2)$ is $f = Ce^{\pm \sqrt{2} x}$. Notice here it is not $f =c_1 e^{\sqrt{2} x} + c_2 e^{-\sqrt{2} x}$, $f$ can be just one, not a linear combination of both. So there is no way $f(0) = f(\pi) = 0$.
