Stably-free ideals are free? In my class of algebraic topology, a friend of mine stated the following: 

If $R\ne 0$ is a commutative ring with unit and $I\subset R\oplus R$ is a submodule such that $(R\oplus R)/I\cong R$, then $I\cong R$ as $R$-modules.

I believe that it is true for PIDs, but (if it is true) how to prove it for any commutative ring?
Thank you!
 A: If it is an isomorphism of $R$-modules, we have the exact sequence 
$$
0 \to I \to R \oplus R \to R \to 0
$$
where $R \oplus R \to R$ is the map $R \oplus R \to (R \oplus R)/I \simeq R$. Since $R$ is a free $R$-module, it is also projective, hence this sequence splits ; this means we have an isomorphism $R \oplus R \simeq I \oplus R$. Since this means $I$ is a direct summand of a free module, this proves that $I$ has to be projective. 
In the case of PIDs, since any projective module is free, we are done. In general, the implication "projective $\Rightarrow$ free" is false. It is also true in the case of a local ring (not easy to prove that projective modules over a local ring are free), so at least you can say $I_P \simeq R_P$ for all prime ideals $P \in \mathrm{Spec} \, R$ (since the localization of a projective module is projective over the localization ; this is an easy statement). Therefore, in full generality, I think the best statement you can get is that $I$ is locally free in the sense defined above ($I_P \simeq R_P$ for all $P$).  
Edit : In the comments lies a sketch of a proof that if $R$ is a noetherian integral domain, then $I \simeq R$. 
Second edit : Lemma 19.18 in Eisenbud's "Commutative Algebra with a view towards Algebraic Geometry" is what you want. The proof is easy if you assume that projective modules over a local ring are free. Thanks to user26857 for that, I learned something today!
Hope that helps,
A: Let $\varphi$ denote the surjection $R\oplus R\to (R\oplus R)/I\cong R$. Define $a=\varphi(1,0)$, $b=\varphi(0,1)\in R$.  Then $\varphi(x,y)=ax+by$. Since $\varphi$ is surjective, we can find $x_0$, $y_0\in R$ with $ax_0+by_0=1$.
Define $\psi:R\to R\oplus R$ by $\psi(r)=(-b r,a r)$. Now:


*

*$\varphi\circ\psi=0$, so the image of $\psi$ is contained in $I$,

*The map $R\oplus R\to R$, $(r,s)\mapsto x_0 s-y_0 r$ is left-inverse to $\psi$, so $\psi$ is injective, and

*For every $(r,s)\in I$, we have $ar+bs =0$, so
$$
\psi(-y_0 r+x_0 s)= (by_0r-bx_0 s,-ay_0r+ax_0 s) = (by_0r+ax_0r, by_0s+ax_0 s) = (r,s),
$$
and we conclude $\psi$ maps onto $I$.
We have shown $\psi$ is an isomorphism of $R$ onto $I$.
A: 
The conclusion holds for any commutative ring.

We have a short exact sequence of $R$-modules $$0\to I\to R\oplus R\to (R\oplus R)/I\to 0.$$ Since $(R\oplus R)/I\simeq R$ the above sequence is split, so $R\oplus R\simeq R\oplus I$. This gives $$\bigwedge^2(R\oplus R)\simeq\bigwedge^2(R\oplus I)\Rightarrow R\simeq I.$$ (For the last isomorphism see this answer.)
Edit. The arguments above can be easily generalized in order to show (for $n\ge2$) $$R^n/I\simeq R^{n-1}\Rightarrow I\simeq R,$$ that is, stably-free ideals are free.
A: It's certainly not true without further assumptions: take $R=\prod_{i\in\mathbb{N}} \mathbb{Z}$, and $I=\mathbb{Z}$.

EDIT: See Pavel's comment; this answer is not correct unless the isomorphism $(R\oplus R)/I\cong R$ is just an isomorphism of rings.
If we demand an isomorphism of modules, then the statement is true: see http://en.wikipedia.org/wiki/Invariant_basis_number.
FURTHER EDIT: Now I'm not sure that my previous edit is really true; oh well. I'm leaving this answer, with edits, up for posterity, but this should not be accepted.
