[tex]y'' + \omega^2 y = 0[/tex]
has characteristic equation
[tex]r^2 + \omega^2 = 0[/tex]
with roots at [tex]r = \pm\sqrt{-\omega^2} = \pm|\omega|i[/tex], hence the characteristic solution is
[tex]y = C_1 e^{i|\omega|x} + C_2 e^{-i|\omega|x}[/tex]
or equivalently,
[tex]y = C_1 \cos(|\omega|x) + C_2 \sin(|\omega|x)[/tex]
With the given boundary conditions, we require
[tex]y(0) = 0 \implies C_1 = 0[/tex]
and
[tex]y'(\pi) = 0 \implies -|\omega| C_1 \sin(|\omega|\pi) + |\omega| C_2 \cos(|\omega|\pi) = 0[/tex]
With [tex]C_1=0[/tex], the second condition reduces to
[tex]|\omega| C_2 \cos(|\omega|\pi) = 0[/tex]
Assuming [tex]C_2\neq0[/tex] (because we don't want the trivial solution [tex]y=0[/tex]), it follows that
[tex]\cos(|\omega|\pi) = 0 \implies |\omega|\pi = \pm\dfrac\pi2 + 2n\pi \implies |\omega| = 2n\pm\dfrac12[/tex]
where [tex]n[/tex] is an integer. In order to ensure [tex]|\omega|\ge0[/tex], we must have [tex]n\ge1[/tex] if [tex]|\omega|=2n-\frac12[/tex], or [tex]n\ge0[/tex] if [tex]|\omega|=2n+\frac12[/tex].