Can the I-fold direct product be free? Let $A$ be a non-zero commutative ring with unit, $I$ a infinite set.

Can  $\prod_{i\in I}A$ be free as an $A$-module?

I found when $A$ is a field or is isomophic to $\mathbb{Z}/m\mathbb{Z}$, then it is free.
But even when $A=\mathbb{Z}$, it is not free. (Baer Specker group)
It seems  $\prod_{i\in I}A$ is always not free when $A$ is a domain with dim$\geq1$?
But I've found it difficult to prove. So I want to prove that when $A$ is PID, $\prod_{i\in I}A$ is always not free.
It is suffice to prove that when $I=\mathbb{N}$, $\prod_{i\in \mathbb{N}}A$ is not free.
we have already checked that when $A$ is not DVR,then $\prod_{i\in \mathbb{N}}A$ is not free. (similar to $\mathbb{Z}$)
we remain DVR need to check. 
My question is :


*

*Is any other $A$ such that $\prod_{i\in I}A$ is free as an $A$-module ?

*Is $\prod_{i\in I}A$  always NOT free when $A$ is an integral domain with dim$\geq1$?
 A: A common generalisation covering the two examples of (1) is an Artinian self-injective (local) algebra $A$. Then the product is injective and any injective is a sum of indecomposable injectives and the only indecomposable injective is $A$ itself.
A: If $A$ is a noetherian domain and not a field then the infinite product $M=A\times A\times \dots$ is not free. Suppose there is a basis. For $x\in M$ define its support to be the finite set of basis elements for which the coefficient is not zero. Note that if the supports of $x$ and $y$ are disjoint then their union is the support of $x+y$. Choose $\pi\in A$ neither zero nor invertible. Define the $n$-support of $x$ to consist of those basis elements for which the coefficient is not divisible by $\pi^n$. Note that $n$-support is contained in $(n+1)$-support is contained in support.
Choose an infinite sequence of nonzero elements $m_1,m_2,\dots $ of $M$ such that 
(1) $m_n$ projects to zero in the first $n-1$ factors of the infinite product,
(2) the $m_n$ have pairwise disjoint support.
To get $m_n$ when all the previous $m_k$ are given, you just have to know that the kernel of a certain map from $M$ to a finite product of copies of $A$ is nontrivial (project the product on the first $n-1$ factors and project the free module on the span of a finite subset of basis).
Then divide each $m_n$ by as high a power of $\pi$ as possible; this preserves 1 and 2 while also arranging
(3) $m_n$ is nonzero mod $\pi$.
Now let $s_n=\pi m_1+\pi^2 m_2+\dots +\pi^nm_n$ and let $s$ be the limit of $s_n$ (defined because of 1). 
The contradiction is that the support of $s$ must contain arbitrarily large finite sets $S_n$: Let $S_n$ be the $(n+1)$-support of $s_n$. Then the support of $s$ contains the $(n+1)$-support of $s$, which equals $S_n$. And $S_n$ properly contains $S_{n-1}$ because it is the disjoint union of the $(n+1)$-support of $s_{n-1}$ and the $(n+1)$-support of $\pi^nm_n$, this last being the (by 3 nonempty) $1$-support of $m_n$.
EDIT  This implies that if $A$ is noetherian and has dimension $>0$ then the infinite product is not free, because $(A/P)\otimes \prod A=\prod (A/P)$ if $P$ is a finitely generated ideal -- choose $P$ to be a non-maximal prime. Also, the argument above proves more than I said: for a noetherian domain the infinite product is not even a submodule of a free module.
A: I believe it is also free for the p-adic integers $\mathbb{Z}_p$.
By restricting to the underlying additive group $G$ of the ring, you certainly require any Cartesian product of copies of $G$ to be isomorphic to some direct sum of copies of $G$, and this itself is an interesting question. For finitely generated abelian groups, I believe it holds if and only if the group has rank 0 (i.e. is torsion), this should follow easily from things you've mentioned already.
(Incidentally, in the world of non-abelian groups, I'm not sure if it holds for $Q_8$ or $D_8$.)
