Answer
$$ y=\frac{1}{2}(x+\frac{1}{2}\sin (2x))+\pi/4 .$$
Work Step by Step
By separation of variables, we have
$$ dy=\cos^2xdx =\frac{1}{2}(1+\cos (2x))dx$$
then by integration, we get
$$ y=\frac{1}{2}(x+\frac{1}{2}\sin (2x))+c .$$
Now, since $y(0)=\pi/4$, then $c=\pi/4 $.
So the general solution is given by $$ y=\frac{1}{2}(x+\frac{1}{2}\sin (2x))+\pi/4 .$$