Need help in showing that $\mathbb{Z}_{m}$ is a principal ideal ring I'm asked to show that $\mathbb{Z}_m$ (the integers mod $m$) is a principal ideal ring for every $m > 0$
I see that it is the same discussion used in verifying that $\mathbb{Z}$ (the set of all integers) is. 
Can anybody help me in writing a correct solution?  
 A: Use that $\Bbb Z_m$ is a quotient of $\Bbb Z$. In general, the residues of the generators of an ideal generate the image of the ideal in the quotient.
A: The ring $\mathbb{Z}_m$ is more correctly denoted $\mathbb{Z}/m\mathbb{Z}$, that is the quotient ring of $\mathbb{Z}$ modulo the ideal $m\mathbb{Z}$. The ring $\mathbb{Z}$ is known to be a principal ideal domain (even Euclidean).
We can prove a more general result.

Theorem. Let $f\colon A\to B$ be surjective homomorphism of commutative rings. If $A$ is a principal ideal ring, then $B$ is a principal ideal ring.

Proof. Let $I$ be an ideal of $B$. Consider
$$
f^{\gets}(I)=\{a\in A:f(a)\in I\}
$$
It's easy to prove that $f^{\gets}(I)$ is an ideal of $A$. Therefore there exists $a\in A$ such that $f^{\gets}(I)=(a)$.
Consider $b=f(a)$; then $I=(b)$. Indeed, $b=f(a)\in I$ by definition, so $(b)\subseteq I$.
Conversely, if $y\in I$, then $y=f(x)$, for some $x\in A$ (here we use surjectivity of $f$). By definition, $x\in f^{\gets}(I)=(a)$, so $x=az$ for some $z\in A$. Hence
$$
y=f(x)=f(az)=f(a)f(z)=bf(z)\in (b)
$$
Therefore $I\subseteq (b)$. QED
Now apply the theorem to the canonical homomorphism $\mathbb{Z}\to\mathbb{Z}/m\mathbb{Z}=\mathbb{Z}_m$.
A: Note that $\mathbb{Z}$ is a PID.
And also note that there is an inclusion preserving bijection between the ideals of $\mathbb{Z}_m$ and ideals of $\mathbb{Z}$ which contain the ideal $m\mathbb{Z}$.
So any ideal of $\mathbb{Z}_m$ looks like $I/m\mathbb{Z}$ where I is an ideal containing the ideal $m\mathbb{Z}$ in $\mathbb{Z}$.
Since I is generated by a single element, so is $I/m\mathbb{Z}$ in $\mathbb{Z}_m$.
Hence $\mathbb{Z}_m$ is a principle ideal ring.
explanation for the missing part
Let $\phi:\mathbb{Z} \rightarrow \mathbb{Z}_{m} $ where $\phi(x) = x+m\mathbb{Z}$ for all x in $\mathbb{Z}$. This is a surjective ring homomorphism.
Note that inverse image of an ideal is an ideal for a ring homomorphism and image of an ideal is an ideal for a surjective ring homomorphism.
So if J is an ideal in $\mathbb{Z}_{m}$, then $\phi^{-1}(J)$ is an ideal in $\mathbb{Z}$ which contains the ideal $m\mathbb{Z}$.
Let $I=\phi^{-1}(J)$ , then I contains $m\mathbb{Z}$ since 0+$m\mathbb{Z}$ is in J.
then $\phi(I)=J=I/m\mathbb{Z}$.
this proves the surjection between the ideals of $\mathbb{Z}_{m}$ and the ideals of $\mathbb{Z}$ which contain the ideal $m\mathbb{Z}$.
Even though inclusion preserving is true, it is not needed for proving your result. 
Since I is a ideal in $\mathbb{Z}$. Let $I=(k)$ for some integer k.
then ideal $(m)\subseteq (k)$. Then k divides m.
So I is the ideal in $\mathbb{Z}$ generated by divisors of m.
A: To start, I want to set up some notation so that my answer doesn't look terribly cluttered. Let $\mathbb{Z}/m\mathbb{Z}$ be denoted as $A$, and the ideal generated by an integer $k$ as $(k)$. Similarly, the ideal generated by $n$ and $k$ will be $(n,k)$. Note that $A=(1)$.
Now, to find the ideals of $A$ for some $m\in\mathbb{Z}^+$, we'll investigate the possible forms an ideal $I\subseteq A$ may have. We note the following property of ideals:

Since by definition of ideals, $kn\in I$ whenever $k\in A$ and $n\in I$, then it follows that $kI = \{kn:k\in A, n\in I\} = I$. 

Suppose that $n\in I$. This tells us that all multiples of $n$ must also be in $I$, and hence $(n)$ is an ideal of $A$. Furthermore, if $\gcd(n,m)=1$ then $n$ is invertible in $A$. Then since $n^{-1}(n)=(n)$, this implies that $1\in(n)$, so $(n)=(1)=A$, so $(n)$ is not a proper ideal. Since this is true for any ideal containing $n$, we may assume that any proper ideal in $A$ contains no invertible elements (also called units).
Now, can there be other ideals? To investigate this, consider two integers, $n$ and $k$, such that $n\notin(k)$ and $k\notin(n)$. Let $\gcd(n,k)=d$. Since $\mathbb{Z}$ is a Euclidean domain, there are integers $a,b\in\mathbb{Z}$ such that $an+bk=d$. Furthermore, this equality still holds in $A$ when we replace $a$ and $b$ with their remainder modulo $m$. This implies that $(n,k)=(d)$, since every element is a multiple of $d$. 
Therefore, any proper ideal of $A$ generated by two elements is also generated by a single element, and hence is principal. This shows that $A$ is a Principal Ideal Domain. 
