Solution (source code)

= Solution

Differentiate to obtain $g'(y)=-1-4\sin y$. Let $\alpha=\arcsin(1/4)$, with $0<\alpha<\pi/2$. All solutions of $g'=0$ are
$$
y=-\alpha+2\pi n\quad\text{or}\quad y=\pi+\alpha+2\pi n,\qquad n\in\mathbb Z.
$$
Since $g''(y)=-4\cos y$, the first family consists of local maxima and the second of local minima. Their function values follow from $4\cos\alpha=\sqrt{15}$:
$$
\boxed{\begin{aligned}
\text{maxima: }&(-\alpha+2\pi n,\ \alpha-2\pi n+\sqrt{15}),\\
\text{minima: }&(\pi+\alpha+2\pi n,\ -\pi-\alpha-2\pi n-\sqrt{15}).
\end{aligned}}
$$
The derivative is periodic, but $g$ itself is not: increasing $y$ by $2\pi$ lowers $g$ by $2\pi$, which accounts for the indexed vertical offsets.