$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?
 A: I find the contrapositive to be the clearest approach:

If $p$ is not prime, then $(p)$ is not maximal.

Indeed, if $p$ is not prime, then $p$ has a proper divisor $a$ with $1 < a < p$.
But then $ \mathbb Z=(1) \supset (a) \supset (p)$, where all inclusions are strict, and $(p)$ is not a maximal ideal.
A: $\langle p \rangle$ is a prime ideal of $(\Bbb Z,+,\cdot)$.
Then we have that $ab\in \langle p \rangle \implies a\in \langle p \rangle$ or $b\in \langle p \rangle$
If $p$ is not prime, then take its prime factors $p=p_1^{\alpha_1}p_2^{\alpha_2}\cdots p_n^{\alpha_n}$ and clearly $$p=p_1^{\alpha_1}p_2^{\alpha_2}\cdots p_n^{\alpha_n}\in \langle p \rangle$$
$$\forall i \in \{1,\cdots,n\}: p_i^{\alpha_i}\not\in\langle p\rangle\quad \text{ (maximal) }$$
Hence $\langle p \rangle$ is not prime(also these would generate a larger ideal), contradiction, hence $p$ is prime.
A: 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. 
A: As you noticed yourself ideal $\left(p\right)$ is also a prime ideal. 
So $nm\in\left(p\right)\implies n\in\left(p\right)\vee m\in\left(p\right)$,
or equivalently $p\mid nm\implies p\mid n\vee p\mid m$. 
This combined with $p\notin\{0,1,-1\}$ makes us say that $p$ is a so called
prime element of $\mathbb{Z}$.
This combined with the positivity of $p$ makes us say that $p$ is a prime number.

edit:
Every prime element is an irreducible element. Proof:
Let $p$ be a prime element and let $p=ab$. 
Then $p\mid a\vee p\mid b$. If $p\mid a$ then $a=rp$ for some $r$. 
Then $p=ab$ leads to $p(1-rb)=0$ and consequently $rb=1$ showing that $b$ is a unit. 
Of course $p\mid b$ will lead to the conclusion that $a$ is a unit.

Applied to $\mathbb Z$ this shows that a prime number can be described as a positive integer that has exactly $2$ positive divisors: $1$ and itself.
A: 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.
