I know that if $R$ is a commutative ring, then $R^n\simeq R^m$ as $R$-modules is equivalent to $n=m$.---(1)
But there is some confusing example.
Let $A=\prod_{n\in \mathbb{N}}R$. Then $A$ is a commutative ring and $$A^2=\prod_{n\in \mathbb{N}}R\times \prod_{n\in \mathbb{N}}R=\prod_{n\in \mathbb{N}}R=A.$$ Thus $A^2$ and $A$ should be isomorphic as $R$-modules. But it contradicts (1) above. What's wrong?
I also have one more question.
If $M$ is free $R$-module and have a finite basis $S$, is it possible to have another infinite basis?
I know if $R$ is commutative ring with unity, the number of basis should be same. But if it is not, I think it is not true. Is there a counter example?
Thanks in advance for your help.