Composition $B \to B/J \to B$ equals identity implies that the ideal $J$ is zero Let $A$ be a commutative ring with $1$ and $B$ an $A$-algebra. Let $J$ be an ideal of $B$ and we consider two arbitrary ring maps preserving $A$-module structure
$f_1: B \to B/J$, $f_2: B/J \to B$ which compose to identity $\mathrm{id}_B = f_2 \circ f_1$.
Question is when the existence of such two maps imply
that $J=0$?
One neccessary condition is to require that $B$ is
finitely generated $A$-algebra, otherwise here is a conterexample:
Take as example
$B= K[X_1, X_2,... ]$, with $K$ arbitry field, $J := (X_1)$ and
consider two $K$-morphisms $f_1: B \to B/J, X_i \mapsto X_{i+1}$
and $f_2: B/J \to B, X_{j+1} \mapsto X_j$. Observe that
$B/J = K[X_2,X_3,...]$ and the composition $f_2 \circ f_1$ is
identity on $B$.
Therefore assume that moreover $B$ is finitely generated $A$-algebra
and there exist $f_1, f_2$ as above with $\mathrm{id}_B = f_2 \circ f_1$.
Does this imply $J=0$? If not, are there any non trivial
conditions one should impose for $B$ to make the claim true?
Let me also note that this problem is closely related
to this question.
 A: Not sure about finitely generated algebra. However, if $B$ is finitely generated as an $A$-module then yes, $J$ must be trivial. Your condition clearly implies that $f_2$ is surjective. So if $\pi:B\to B/J$ is the canonical projection then $f_2\circ\pi:B\to B$ is a surjective homomorphism of $A$-modules. Since $B$ is finitely generated, we conclude that $f_2\circ\pi$ is an isomorphism. (a standard result obtained from Nakayama's lemma). In particular $\pi$ is injective, and so $J=0$.
Edit: We'll show why if $B$ is a finitely generated module and $T:B\to B$ is a surjective homomorphism of modules then $T$ is injective. We can define an $A[x]$-module structure on $B$ by $p(x).b=p(T)(b)$. In particular, $x.b=T(b)$ for all $b\in B$. Now let $I\subseteq A[x]$ be the ideal generated by the polynomial $x$. Since $T$ is surjective we have $IB=B$. From one of the versions of Nakayama's lemma (just noticed that in Atiyah-Macdonald it appears right before Nakayama's lemma, it is corollary 2.5 in chapter 2) there exists some element $p(x)\in A[x]$ such that $p(x)\equiv 1$ (mod $I$) and $p(x)B=0$. Thus $q(x):=1-p(x)$ is an element of $I$ such that $q(x).b=b$ for all $b\in B$.
Finally, since $I$ is generated by $x$ we know there is some polynomial $u(x)\in A[x]$ such that $q(x)=u(x)x$. And now define $S:B\to B$ by $S(b)=u(x).b$. This is clearly a homomorphism of $A$-modules, and:
$ST(b)=u(x).T(b)=u(x).(x.b)=u(x)x.b=q(x).b=b$
So we found a left inverse of $T$, which means it is injective.
