$p$ is a positive integer and $(p)$ is a maximal ideal in the ring $(\mathbb Z, +,\cdot)$, then $p$ is a prime number I need to prove: $p$ is a positive integer and $(p)$ is a maximal ideal in the ring $(\mathbb Z, +,\cdot)$, then $p$ is a prime number. 
My attempt: 
1) $(p)$ is a maximal ideal, so it is a prime ideal.
2) Assume $p$ is not prime, then $p = ab, a,b \in \mathbb Z, a>0, b>0,a \ne 1,p$. 
3) Because $(p)$ is a prime ideal, it means that either $b=z_1p$ or $a=z_2p, z_1>0,z_2>0, z_1,z_2 \in \mathbb Z$. 
4) Assume that $b=z_1p$, then $1=az_1$ so $a= 1, z_1 =1$.
5) Assume that $a=z_2p$, then $1=bz_2$, so $b= 1, z_1 =1$, but then $a=p$.
Thus $p$ must be prime.
Is it a correct proof?

Let my try to elaborate answering this.
Assume $I=\langle p \rangle$ is an ideal of $\Bbb Z$ for some prime $p$. Let $J$ be an ideal of $\Bbb Z$ with $I\subseteq J$. Since $\Bbb Z$ is a PID, $J=\langle a \rangle$ for some $a\in \Bbb Z$. Thus, $\langle p \rangle \subseteq \langle a \rangle$. If $\langle p \rangle \subsetneq \langle a \rangle$, then $a\notin \langle p \rangle$ (since otherwise $\langle a \rangle\subseteq \langle p \rangle$). So $p\nmid a$ and hence $\gcd(p,a)=1$. So, $1=sp+ta$ for some $s,t\in \Bbb Z$. Since $p\in \langle a \rangle$, is is $1\in \langle a \rangle$ and therefore $\langle a \rangle = \Bbb Z$. Hence $I$ is maximal.
Conversely, let $I=\langle a \rangle$ be a maximal ideal of $\Bbb Z$, so $a\neq \pm 1$. Also, $a\neq 0$, since $\{0\}\subsetneq \langle z \rangle \subsetneq \Bbb Z$ for all $z\in \Bbb Z\setminus\{0,\pm1\}$. If $a$ is not a prime number, then $a=xy$ for some non-zero integers $x,y\neq \pm 1,\pm a$. Thus, $\langle a \rangle \subsetneq \langle x \rangle,\langle y \rangle \subsetneq \Bbb Z$, contradiction by the maximality of the ideal. So, $a$ must be prime.

Alternative way: Let $n > 1$. We have $\langle n \rangle \neq \Bbb Z$ is maximal iff $\Bbb Z/\langle n \rangle=\Bbb Z_n$ is a field iff $n$ is a prime number.
