$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 $p$ be a nonprime number, thus $p$ can be factored in to two non-unit coprime  numbers, say $x$ and $y$ ($p = xy$, $\gcd(x, y) = 1$). Since $x$ and $y$ are non-units, so $\langle p \rangle \subset \langle x \rangle \neq \textbf{Z}$ and $\langle p \rangle \subset \langle y \rangle \neq \textbf{Z}$ (if $\langle p \rangle = \langle x \rangle$, then $x = nxy$, so $y$ is a unit). This shows that $\langle p \rangle$ is not maximal ideal. 
