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.
In your example $A\simeq A^2$ as rings, but not as $A$-modules. (As you already know, this is not possible.)
A free module can't have a finite and an infinite basis. Suppose it has a finite basis $x_1,\dots,x_n$ and an infinite basis $(y_i)_{i\in I}$. Then each $x_j$ is a (finite) linear combination of the $y_i$'s. Let $J\subset I$ be a finite subset which contains all indices of the $y_i$'s which appear in a linear combination as mentioned above. Then they form a system of generators (actually a basis) for our module, so any other $y_j$ is a linear combination of them, a contradiction.