Let $0 \to A \to B \to C \to 0$ be a short exact sequence of modules over a commutative ring $R$ containing $1 \ne 0$. Suppose this is also another exact sequence $0 \to C \to B \to A \to 0$. Do these two short exact sequences imply $B \cong A \oplus C$?
It seems true but I can not find a convincing proof. Could anybody give an answer? If it is false in general, could it be valid if we restrict $R$ to for example PID or DVR? Thank you.
Consider $R = \mathbb{Z}$ and $A=C= \mathbb{Z}/(p)$ and $B=\mathbb{Z}/(p^2)$ and the short exact sequence
$$0 \to \mathbb{Z}/(p) \to \mathbb{Z}/(p^2) \to \mathbb{Z}/(p) \to 0$$
where the first morphism is given by $1\mapsto p$, the second is the projection mod$(p)$.
Clearly for $p$ prime, this does not split, since $\mathbb{Z}/(p^2)$ is not isomorphic to $\mathbb{Z}/(p) \times \mathbb{Z}/(p)$.
Similar examples should work for any PID.
Furthermore, localizing at any prime ideal $\mathfrak{p}$ yields a short exact sequence over the localization $\mathbb{Z}_{(\mathfrak{p})}$, which is a DVR. The induced short exact sequence does not split
(at least not for all prime ideals, since $\mathbb{Z}/(p^2)_{(\mathfrak{p})} \cong (\mathbb{Z}/(p) \times \mathbb{Z}/(p))_{(\mathfrak{p})}$ for all primes $\mathfrak{p}$ would imply, that $\mathbb{Z}/(p^2)\cong \mathbb{Z}/(p) \times \mathbb{Z}/(p)$ (by Atiyah-MacDonald 3.9)).