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 ?
 A: You seem to be assuming that all the ideals of $\mathbb Z$ are linearly ordered, but they're not.
A: Someone has proposed that you thought that the ideals of $\mathbb Z$ are linearly ordered, but I have a feeling that the mistake was actually simpler than that, and "upstream" so to speak. I think it is just an error in quantification.
It should read

“for all $n’$, if $(n’)\supseteq (n)$ it follows that A or B.”

and not

“for all $n’$, it follows that A or B.”

A stands for $(n')=(n)$ and B stands for $(n')=R$, but I wanted to disguise that the conditions themselves are not important. What was important was the missing "if."
The second one implies that all ideals of $R$ are comparable to $(n)$ (which can be exaggerated to "all ideals are in a chain" as the other solution thought.)

To connect this with your original definition, which was correct:

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

This would be logically equivalent to

"If $I\subseteq J \subseteq R$, then $J=I$ or $J=R$."

The misstep you wrote looked like this:

"If $J \subseteq R$, then $J=I$ or $J=R$."

A: If you follow the definition of maximal ideals, then for $\mathbb{Z}$, you have
that $(n)$ is a maximal ideal if and only if

*

*$(n)\ne\mathbb{Z}$;

*there is no ideal $(m)$ of $\mathbb{Z}$ such that $(n)\subsetneq (m)\subsetneq\mathbb{R}$.

The second condition does not imply that for every $m\in\mathbb{Z}$ (and $m\ne 1$), $(m)\subset (n)$.

For two integers $m$ and $n$, exactly one of the following is true:
$$
m<n,\quad m=n,\quad m>n
$$
Hence if $m\ge n$ is not true, you must have $m<n$.
However, for two ideals $(m)$ $(n)$, it is possible that none of the following is true
$$
(m)\subset(n),\quad (m)=(n),\quad (m)\supset(n)
$$
Consider for instance the example $m=3$ and $n=5$.
