I stumbled across this seemingly trivial problem while trying to solve it as a subproblem for an exercise in Weibel's Homological Algebra:
Given a commutative ring $R$ and three $R$-modules $A$, $B$ and $C$ such that $C=A \oplus B$, and $C$ and $A$ are free modules. Need $B$ also be a free module?
Also, if the answer is negative, is there a particularly nice class of rings (e.g. integral domains, PIDs) where this would hold?
I have tried some pretty direct approaches analogue to standard techniques in linear algebra (like trying to complete a basis of $A$ for example), but nothing that direct seems to work?