How to prove $(1+i)$ is a prime in $\mathbb{Q}(i)$? I know the definition of prime in $\mathbb{Q}(\sqrt{m})$ that is an algebraic integer is a prime if it is divisible by its associates and units of the field. Units of $\mathbb{Q}(i)$ are $+1,-1,i,-i$
 How to solve this example?please help me.
 A: It's a bit hard to tell what you're actually asking, here. $\Bbb Q(i)$ is a field, so every non-zero element of $\Bbb Q(i)$ is a unit (and talking about primes doesn't really make sense). After all, let's suppose $a+bi\in\Bbb Q(i)$ with $a,b$ not both zero. Then the following are equivalent: $$(a+bi)(c+di)=1$$ $$ac-bd+(ad+bc)i=1$$ $$ac-bd=1\text{ and }ad+bc=0\tag{1}$$ Since $a,b$ are not both zero, then we can solve the left equation in $(1)$ for one of $c,d$ and the right equation for the other one.
I suspect, instead, that you're interested in $\Bbb Z[i]:=\{a+bi:a,b\in\Bbb Z\}.$ In that case, the units are $1,-1,i,-i,$ as you say, and $1+i$ is, indeed, prime.
To prove it, let's suppose that $$1+i=(a+bi)(c+di)$$ for some integers $a,b,c,d.$ Then $$|1+i|=|a+bi||c+di|$$ $$|1+i|^2=|a+bi|^2|c+di|^2$$ $$2=\left(a^2+b^2\right)\left(c^2+d^2\right),$$ but since $a^2+b^2$ and $c^2+d^2$ are both integers--in fact, positive integers--and $2$ is a prime number, then one of them must be equal to $1.$
Without loss of generality, say $a^2+b^2=1.$ Can you take it from there?
