Given an integer $m=pq$, where $p,q$ are both primes such that $p\equiv 1 \pmod{4}, q\equiv 1 \pmod{4}$. It is known that $p$ can be written as a sum of two squares (of positive integers) in a unique way, and the same for $q$. Prove that $m$ can be written as a sum of two squares (of positive integers) in exactly two distinct ways.
Attempt
Notice that for positive integers $u,v,A,B$, we have \begin{align*}(u^2+v^2)(A^2+B^2)&=(uA+vB)^2+(vA-uB)^2=(vA+uB)^2+(uA-vB)^2\end{align*} Therefore if $p=a^2+b^2,q=c^2+d^2$, then \begin{align*}m&=(a^2+b^2)(c^2+d^2)=(ac+bd)^2+(bc-ad)^2=(bc+ad)^2+(ac-bd)^2\end{align*} meaning that $m$ can be written as a sum of two squares (of positive integers) in at least two distinct ways.
How do I prove that there doesn't exist a third way of writing $m$ as a sum of two squares (of positive integers)?
This is strictly related with the number of ways of writing $pq$ as $z\bar{z}$ in $\mathbb{Z}[i]$, that is an Euclidean domain, hence a UFD. See this other question for details.
@LiebsterJugendtraum: my answer involves ring theory, more than group theory, but just a little. To this "by hand", you can use Lagrange's identity and try to prove that, assuming that $pq$ has $3$ (or more) distinct representations as a sum of two squares, then $(-1)$ is the square of too many elements in $\mathbb{F}_p^*$ or in $\mathbb{F}_q^*$.