An integer $n$ is a perfect square if and only if it can be expressed as the square of some other integer i.e. there exists some integer $a$ such that $n=a^2$.
Prove that if $n$ is a perfect square, then either $n \equiv 1 ~(\mod 4)$, or $n \equiv 0 ~(\mod 4)$.
How can I prove this?
Either $a \equiv 0 ~[4]$, or $a \equiv 1 ~[4]$, or $a \equiv 2 ~[4]$, or $a \equiv 3 ~[4]$. From this, What can you say about $n = a^2$ modulo 4?