I have a homework as follow:
if $5\nmid a$ or $5\nmid b$, then $5\nmid a^2-2b^2$.
Please help to prove it.
EDIT: MY ATTEMPT
Suppose that $5\mid a^2-2b^2$, then $a^2-2b^2=5n$,where $n\in Z$,
then $a^2-2b^2=(a+\sqrt2b)(a-\sqrt2b)=5n$,
Since 5 is a prime number, we get that $5\mid (a+\sqrt2b)$or $5\mid (a-\sqrt2b)$,
If $5\mid (a+\sqrt2b)$, then $5\mid a$ and $5\mid b$, contradiction.
If $5\mid (a-\sqrt2b)$, then $5\mid a$ and $5\mid b$, contradiction.
Thus $5\nmid a^2-2b^2$.
You just have to make a table for the function $a^2-5b^2$ in $\mathbf Z/5\mathbf Z$ above the horizontal line, the possible values for $a^2$; to the left of the vertical line, those for $b^2$): $$\begin{array}{r|rrr} &0&1&-1\\ \hline 0&0&1&-1\\1&-2&-1&2\\-1&2&-2&1 \end{array}$$ which shows the only case with $a^2-5b^2\equiv 0\mod5$ is when $a\equiv b\equiv 0\mod5$.