I want to find all prime ideals in $\mathbb{Z}/n\mathbb{Z}$ where $n>1$.
I think I have to use the following theorem (because they asked me to prove it right before this exercise, which wasn't too complicated):
Let R be a ring and I ⊂ R an ideal. Let φ : R → R/I be the natural residue class homomorphism. Let I ⊂ J be another ideal. Then J is a prime ideal in R if and only if φ(J) is a prime ideal in R/I.
And
Let R be a principal ideal domain and $I\subset R, I\neq(0)$ an ideal. Then every ideal generated by a irreducible element is a prime ideal
An irreducible element in $\mathbb{Z}$ are exactly the prime numbers. I also know that $\mathbb{Z}$ is a principal ideal domain.
I tried supposing that $J=(p)$ is an ideal of $\mathbb{Z}$, and when $p$ prime, it is a prime ideal. Then if $J$ is a superset of $n\mathbb{Z}$, we have that $\phi(J)$ is a prime ideal of $\mathbb{Z}/n\mathbb{Z}$. Is this correct? For what $p$ values does this hold? What if $J$ is not a superset of $n\mathbb{Z}$ as the theorem requires?
Another theorem says the prime ideals of $R/I$ correspond bijectively to the prime ideals of $R$ containing $I$.
In the case of $\mathbf Z/n\mathbf Z$, this means its prime ideals are generated by the congruence classes of the prime divisors of $n$.
If $J=(m)$ does not contain $n$, i.e. if $m$ does not divide $m$, the image of $J$ in $\mathbf Z/n\mathbf Z$ is the ideal $$J\cdot \mathbf Z/n\mathbf Z=(m)\cdot \mathbf Z/n\mathbf Z=(m,n)/(n)=(\gcd(m,n))/(n).$$