Suppose $p$ is a prime such that $p \equiv 5,7\ (\text{mod}\ 8)$ then I want to show that there exist no integral solutions $(x,y)$ such that $x^2+2y^2 = p$.
My idea was to look at the equation modulo $2$. We get $x^2 \equiv 1 (\text{mod}\ 2)$. But this has solutions for $x \in \mathbb{Z}$.
Then what am I missing? or is the statement false?
From $x^2\equiv 1\pmod{2}$. You got that $x$ has to be odd. You have two options:
$x,y$ odd. Then $x^2+2y^2\equiv 1+2=3\pmod{8}$.
$x$ odd, $y$ even. Then $x^2+2y^2\equiv 1+0=1\pmod{8}$.
And you are done.