TITLE: For a finitely generated ideal $I$, $I^2=I$ implies $A/I$ is flat over $A$ or $I$ is principal with an idempotent
QUESTION [6 upvotes]: This is exercise 1.2.4 from Liu's Algebraic Geometry and Algebraic Curves

Let $I$ be a finitely generated ideal of a (commutative with $1$) ring $A$. The following are equivalent:
(a) $A/I$ is flat over $A$
(b) $I=I^2$
(c) There exists an $e\in A$ with $e^2=e$ and $I=eA$

After writing down the question and my concerns, I inevitably found the answer which I'm posting below. I still would like to know if there is a way to prove (b) implies (a), and if Liu's Nakayama's lemma (as stated below), is enough to prove (b) implies (c).

Let $(A,\mathfrak m)$ local, $M$ a finitely generated module and $M=\mathfrak m M$. Then $M=0$.

REPLY [4 votes]: Here is a proof that (b) implies (c) using just the local Nakayama lemma.  Suppose $I^2=I$ and let $P\subset A$ be any prime ideal containing $I$.  Localizing at $P$, we find that $I_P=I_P^2\subseteq P_PI_P$ and so $I_P=0$ by Nakayama.  This means (again using the fact that $I$ is finitely generated) there exists some $s\in A\setminus P$ such that $sI=0$.
Now let $J=\{s\in A:sI=0\}$.  By the discussion above, $J$ is not contained in any prime ideal containing $I$.  That is, $I+J$ is not contained in any prime ideal, so $I+J=A$.  Now pick $e\in I$ and $f\in J$ such that $e+f=1$.  For any $i\in I$, we then have $$i=(e+f)i=ei+fi=ei$$ since $fI=0$.  This implies that $e$ generates $I$, and also that $e^2=e$ by taking $i=e$, as desired.