This problem comes from this commutative algebra problem



> 
> Let $R$ be a commutative ring with identity, $I$ is a finite generated
> ideal of $R$ such that $I^2=I$, then exists $e\in R$ such that $I=Re$.
> 
> 
> 


This problem can be proved using the Nakayama lemma, but the condition for finite generated is necessary? If I isn't finitely generated, does the conclusion still hold? follow



> 
> Let $R$ be a commutative ring with identity, $I$ is an
> ideal of $R$ such that $I^2=I$, then exists $e\in R$ such that $I=Re$.
> 
> 
> 


How to prove this? Or there is a counter-example to disprove.



Can every idempotent ideal be generated by an idempotent?
I have a counterexample from analysis. Let $R= C[0,1]$, the ring of real-valued continuous functions on the unit interval, and let $$I = \{ f \in C[0,1] : f(0) = 0 \}.$$
Then $I$ cannot be generated by any idempotent $p$, for if it were $p$ would have to satisfy $p(0) =0$ and $p(x) = 1 \ (x \neq 0)$, contradicting continuity. However you can check that $I^2 = I$: if $f\in I$ and $f(x) \geq 0 \ (x \in [0,1])$, then $f = (\sqrt{f})^2$ shows that $f \in I^2$; for general $f \in I$, decompose the function into its positive and negative parts.


