If we want for example to determine whether there is an $x \in \mathbb{Z}$ such that $x^2 \equiv 2 \mod 15$, it suffices to calculate $2^2=4,3^2=9,4^2=1,5^2=10,6^2=6,7^2=4$, because we have again $4$, we know that there is not such an $x$. Why is this true in particular? Why we know for sure that $8^2,9^2,...,14^2$ is again equal to one of previous squares?
Thanks in advance.