Solution (source code)

= Solution

Use the standard convention that an <integral domain> has $1\ne0$. Since $(n)=(-n)$, the sign of a nonzero $n$ makes no difference. For $|n|=p$ prime, every nonzero residue has an inverse by <Bézout's identity>, so the <quotient ring> is a <field> and hence an <integral domain>. If $|n|=ab$ is composite with $1<a,b<|n|$, the nonzero classes of $a$ and $b$ multiply to zero, giving <zero divisors>. For $n=\pm1$, the quotient is the <zero ring>, excluded by the convention above. Finally, $n=0$ gives $\mathbb Z/(0)\cong\mathbb Z$, an <integral domain>. Thus
$$
\boxed{n=0\quad\text{or}\quad |n|\text{ is prime}.}
$$
If a convention restricts this notation to positive moduli, the answer is simply the positive primes.