Over Gaussian integers, can every prime be $p \equiv 1 \text{ mod }4$ be expressed as $(a + bi)(a - bi)$ in almost unique manner? Over the Gaussian integers, can every prime $p \equiv 1 \text{ mod }4$ be expressed as $(a + bi)(a - bi)$ in an almost unique manner, unique up to negation of $a$ and/or $b$?

First of all one must clearly stress that the decomposition is taken in $\textbf{Z}[i]$, not in $\textbf{Q}(i)$. Because if $p = (a + ib)(a - ib) = N(z)$, where $N$ denotes the norm map of $\textbf{Q}(i)/\textbf{Q}$ and $z = a + ib$, any $u$ of norm 1 will also give $p = N(uz)$. The elements $u$ of norm $1$ in $\textbf{Q}(i)$ are given e.g. by Hilbert 90, they are of the form $u = (x + iy)/(x - iy)$, so there is certainly not unicity in $\textbf{Q}(i)$. However, the elements $u$ in $\textbf{Z}[i]$ of norm $1$ are invertible, and are easily shown to form the cyclic group generated by $i$, so that up to these, there is unicity in $\textbf{Z}[i]$. 
To answer user1952009's other question, the argument for proving that any $p$ congruent to $1 \bmod 4$ is a sum of squares relies on the decomposition of the ideal $\langle p \rangle$ into a product of prime ideals in $\textbf{Z}[i]$. General criteria for  quadratic fields show that $\langle p \rangle = \mathfrak P. \mathfrak P'$, hence taking norms yields $N(\mathfrak P) N(\mathfrak P') = p^2$. As $N(\mathfrak P)$ and $N(\mathfrak P')$ are not $1$, necessarily $N(\mathfrak P) = N(\mathfrak P') = p$. Since $\textbf{Z}[i]$ is a PID, $\mathfrak P$ is of the form $(a + ib)$, and we are done.
