Confusion about the definition of maximal ideal In my book, the definition of a maximal ideal is as follows:
Let $R$ be a commutative ring. A maximal ideal of $R$ is an ideal $I$ such that:

*

*$I \neq R$.

*There exists no ideal $J$ of $R$ such that $I \subsetneq J \subsetneq R$.

When trying to prove the following statement:
$I$ is a maximal ideal of $\mathbb{Z} \implies I = (p)$ with $p$ a prime number.
I came up with an error in my reasoning, but do not understand at all why it is an error. Because all ideals of $\mathbb{Z}$ are of the form $(n)$ with $n \in \mathbb{Z}$, I know that $I = (n)$. So I tried formulating the definition of maximal ideal as follows:
$\forall n' \in \mathbb{Z}: (n') = \mathbb{Z} \ $ or $ \ (n') \subset (n)$.
But this must obviously be false because then $n$ would be a divisor of all $n' \in \mathbb{Z}$, so that $n = 1$ and thus $(n) = \mathbb{Z}$. This cannot be the case since $I$ is a maximal ideal. Where did my reasoning go wrong ?

You seem to be assuming that all the ideals of $\mathbb Z$ are linearly ordered, but they're not.
