TITLE: Module which is not direct sum of indecomposable submodules
QUESTION [11 upvotes]: I would like to find an example of a ring $R$ and a $R$-module $M$, which can't be written as a direct sum of indecomposable submodules, i.e.
  $$ M \not \cong \bigoplus\limits_{i \in I} M_i$$
  for all set $\{M_i \;\vert\; i \in I \}$ of indecomposable submodules.

In that case, I know that $M$ should be neither noetherian nor artinian, but I wasn't able to find such an example. Any help would be appreciated!

REPLY [7 votes]: A good way to find examples like this is to look at infinite products.  For instance, let $k$ be a field (or more generally, any ring with no nontrivial idempotent elements), let $T$ be an infinite set, let $R=k^T$ (a product of copies of $k$ indexed by $T$), and let $M=R$.  It is not too hard to show that any direct summand of $M$ is of the form $k^S$ for some subset $S\subseteq T$ (to show this, use the fact that any direct summand of a ring as a module over itself is generated by an idempotent).  Thus the only indecomposable direct summands of $M$ are those of the form $k^S$ when $S$ is a singleton.  But the direct sum of all of these is just the infinite direct sum $k^{\oplus T}$, which is the proper submodule of $M$ consisting only of elements which are $0$ on all but finitely many coordinates.  Thus $M$ is not a direct sum of indecomposable submodules.
Here's another example, which shows you don't have to be working over some big complicated ring.  Take $R=\mathbb{Z}$ and let $M=\mathbb{Z}^T$ for any infinite set $T$.  I claim that $M$ is not a direct sum of indecomposable submodules.  Since $M$ is not free, it suffices to show that any indecomposable submodule of $M$ is isomorphic to $\mathbb{Z}$.  To show this, note that if $N\subseteq M$ is any nonzero submodule, then for some $t\in T$ the projection $p_t:N\to\mathbb{Z}$ onto the $t$th factor of the product is nonzero.  Thus $p_t(N)=n\mathbb{Z}$ for some nonzero $n\in\mathbb{Z}$, and since $n\mathbb{Z}$ is free the surjection $p_t:N\to n\mathbb{Z}$ splits and gives a direct summand of $N$ isomorphic to $n\mathbb{Z}\cong \mathbb{Z}$.  So if $N$ is indecomposable, it must be isomorphic to $\mathbb{Z}$.