If \(\displaystyle \int_{0}^{\pi } y^2 dx =1 \; , \; y(0)=y(\pi)=0\) . Minimize \(\displaystyle I=\int_{0}^{\pi} y'^2 dx\).
should I use partial integration and where ? I'm a beginner on these type of problems and the book gives not a single hint.

This is a calculus of variations problem. You should take the functional derivative of $I$ and set it to zero to get the corresponding Euler-Lagrange equations. Where did you get that $y = \pm \sqrt{2/\pi} \sin (x)$?