Solution
= Solution
Write $a_1-a_2=kn$ with $k\in\mathbb Z$. The <difference of two squares> factors as
$$
a_1^2-a_2^2=(a_1-a_2)(a_1+a_2)=n\,k(a_1+a_2).
$$
The final factor is an <integer>, so $n$ divides the difference. By <congruence modulo an integer>, $\boxed{a_1^2\equiv a_2^2\pmod n}$.