Direct sum of two non-zero $R$-modules 
*

*If $R$ is a commutative integral domain, how can I show that it cannot decompose as a direct sum of two non-zero $R$-modules (when viewed as a module over itself). 

*If $n\geq 1$, is there an example of a ring which is isomorphic to a direct sum of $n$ simple modules over itself? 


I am kind of confused with modules and help will be appreciated.
Thanks
 A: Suppose $R=I\oplus J$, where $I$ and $J$ are ideals of $R$, with $I\cap J=\{0\}$. Then
$$
1=x+y
$$
with $x\in I$ and $y\in J$. It follows that $x=x(x+y)=x^2+xy$. Since $xy\in J$ and $xy=x^2-x\in I$, we have $xy=0$.
Since $R$ is a domain, we have either $x=0$ or $y=0$. In the first case $y=1$ and $J=R$, in the second case $x=1$ and $I=R$.
A finite direct product of fields is the answer to your second question. 
By the Wedderburn-Artin theorem it is actually the only possibility. A ring which is the direct sum of simple submodules is semisimple artinian and so, by the Wedderburn-Artin theorem it is the direct product of full matrix rings over division rings:
$$
R=\prod_{i=1}^n M_{n_i}(D_i)
$$
Commutativity of $R$ forces $n_i=1$ and $D_i$ being a field.
A: *

*Suppose that $R=M\oplus M'$ with $M\neq 0\neq M'$. Then $(m,0)\cdot(0,m')=0$ for $m\neq 0\neq m'$ which is a contradiction to $R$ being an integral domain.

*Let $e\in R$ be idempotent, that is to say $e^2=e$ and $e\neq 1$. (For example $(1,0)\in K^2$ for any field $K$). Then $R=R(1-e)\oplus Re$ (easy exercise). In our example this leads to $R=K\oplus K$ as $R$-module, which shouldn't be too shocking. And $K\oplus 0\subset R$ is simple since it is a field. You can generalise this directly for $R=K^n$.

