Sum of two squares in a $\Bbb Z/p\Bbb Z$ I need to show that every element in $\Bbb Z/p\Bbb Z$ can be written as a sum of two squares. The case $p=2$ is trivial and $0$ is always $0^2 + 0^2$. So all I have to do is show that every element of $(\Bbb Z/p\Bbb Z)^\times$ (the group of units) can be expressed as a sum of two squares. The question hints that I should consider the set of elements of $(\Bbb Z/p\Bbb Z)^\times$ expressible as a sum of two squares.
Associativity is trivial, the identity element $1 = 1^2 + 0^2$ exists.
Closure holds by the identity $(a^2 + b^2)(c^2 + d^2) = (ac + bd)^2 + (ad - bc)^2$.
I don't know how to show that inverses exist.

For finite groups, to show that a subset is a subgroup if you check closure and non-emptyness you don't need to check inverses because each element has finite order: $g^{-1} = g^{o(g) - 1}$ is in the subset by closure assumption.
