Is there an example of a module $M$ (over a commutative ring) that is not free, and such that each of its finitely generated submodule is semisimple (i.e. such that any submodule of any finitely generated submodule $N$ of $M$ is a direct factor of $N$) ?



Module such that every finitely generated submodule is semisimple
@Mohan has already given an example in the comments. If you ask that the ring $A$ injects into $End\_A(M)$, then here is an example. Let $M=\oplus {\mathbb Z}/p{\mathbb Z}$ be the $\mathbb Z$-module (= an abelian group). Here $p$ runs over all primes. Then $M$ is not free and every finitely generated submodule is of the form $\oplus \_{p \in S} {\mathbb Z}/p{\mathbb Z}$ where $S$ is a finite set of primes $p$. Hence $S$ is semi-simple. 


