Answer
$y=2\ cos(2x)$
Work Step by Step
As $f(0)\ne0$, use the form $y=a\ cos(bx)$. We can identify the period as $p=\pi$, thus $\frac{2\pi}{b}=\pi$ and $b=2$. We can find the amplitude as $2$, let $a=2$ which is good for $f(0)=2$. The answer is $y=2\ cos(2x)$