quadratic residue...
1. Prove that is x^2 = a(mod n), then (n-x)^2 = a(mod n)
2. If p is a prime number and both a and b are quadratic residues mod p, prove that ab(mod p) is also a quadratic residue mod p.
It is not that n is 0!
But n belongs to the equivalence class of 0. Put in layman terms, when we are seeing only remainders, n leaves the same remainder as 0 when they are divided by n, so they are equivalent.
To prove that directly from definition(if you are new to congruences)