Exercise about prime ideals Let $A$ be a ring. Prove that the following conditions are equivalent:
$i)$  All ideals $I \subsetneq A$ are prime.
$ii)$ The set of all ideals of $A$ is totally ordered by
inclusion and all ideals of $A$ are idempotent.
Please give me a hint. I dont see the relation between these two statemens.
 A: First suppose the ideals are linearly ordered and they are all idempotent. 
We will show that a proper ideal $C\lhd R$ is prime: Let $A,B$ be two other ideals such that $AB\subseteq C$. By way of contradiction, suppose that neither $A$ nor $B$ are contained in $C$. By the linear order, the three form a chain with $C$ at the bottom, so, without loss of generality, we suppose $C\subseteq B\subseteq A$. But then $C\supseteq AB\supseteq BB=B$. This contradicts the statement that $B$ is not contained in $C$. Thus, $C$ is prime.

The other direction is easy of course! Suppose all proper ideals of $R$ are prime. 
Firstly, for any ideal $A$, $A^2$ is prime. But then by primeness $A\subseteq A^2$, so that $A=A^2$.
Secondly, given two ideals $A,B$, the product $AB$ is a prime ideal. But by primeness, either $A\subseteq AB$ or $B \subseteq AB$. In the first case, $A\subseteq AB\subseteq B$ and in the second, $B\subseteq AB\subseteq A$.

Considering the classic commutative theory result (A commutative ring in which all proper ideals are prime is a field."), this exercise shows that the direct noncommutative analogue ("All ideals prime implies division ring???") is not going to hold." Of course, any full square matrix ring $M_n(F)$  over a field ($n>1$) has only one proper ideal, which is prime, and this shows that such a ring does not have to be a division ring.
But with a suitable definition of a prime right ideal the result can be saved! In Lam and Reyes's excellent paper A one-sided prime ideal principle for noncommutative rings such a definition of "prime right ideal" is given, and it's an elementary result shown there that a ring whose right ideals are all prime in this way is a division ring. (Actually the paper is full of much more interesting results, and I just can't resist plugging it here.)
A: Assume (i).
Let $\mathfrak a,\mathfrak b\subsetneq A$ be two ideals and assume $\mathfrak a$ is not contained in $\mathfrak b$, i.e. there exists $a\in\mathfrak a\setminus \mathfrak b$. Then for $b\in\mathfrak b$, we have $aAb\subseteq\mathfrak a\cap \mathfrak b$. As the latter is a prime ideal and $a\notin\mathfrak a\cap \mathfrak b$, we conclude $b\in\mathfrak a\cap \mathfrak b\subseteq \mathfrak a$, in other words $\mathfrak b\subseteq \mathfrak a$.
Similarly, if $a\in \mathfrak a$, then $aAa\in\mathfrak a^2$ implies $a\in\mathfrak a^2$, i.e. $\mathfrak a=\mathfrak a^2$.
