Artificial intelligent assistant

$I$ finitely generated ideal with $I=I^2$, then $I$ is a direct summand of $R$ > Let $R$ be a commutative ring, and let $I$ be a finitely generated ideal in $R$ with $I=I^2$. Show that $I$ is a direct summand of $R$. I managed to understand that $(1-z)I=0$ for some $z \in I$ with the property $z=z^2$. The solution says that it yields that $I$ is a direct summand. How to show the following statement? > Let $R$ be a ring, $I$ be an ideal of $R$ and $e$ be an impotent element of $I$. Then $R=eI\oplus J$ for some $J$ Help me.

If $e$ is an idempotent then so is $1-e$ and $e(1-e)=0$. This means that $(e)\cap(1-e)=0$. Now notice that for all $r\in R$, $r=re+r(1-e)$ so $R=(e)\oplus (1-e)$. But $(e)\subset I$ and $I\cap (1-e)=0$ so $(e)=I$.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 9e310e43267ec012ffb34d0d3bcd35f1