Here is the example I know:
Consider the ring $R = \mathbb Z_2 \times \mathbb Z_2$ and the submodule $\mathbb Z_2 \times \{0\}.$ it is by construction a direct summand of $R$ but certainly not free.And it's finitely generated.
But I do not understand:
1- how $\mathbb Z_2 \times \{0\}$ is a direct summand of $R$ by construction?
2- Why $\mathbb Z_2 \times \{0\}$ is not free?
Any clarification is very much appreciated.
I know that it is finitely generated because it is generated by $\{(0,0) , (1,0)\}.$
It's a direct summand, because for abelian groups $G \oplus H \simeq G \times H$ and the module structure is the same as the group structure.
It's not free, because there is a non-trivial relation $r \cdot (1,0) = (0,0)$, which is the zero element of $R$. In this case, $r = (0,1)$. That's the definition of free: Since $\lbrace (1,0), (0,1) \rbrace$, which we denote by $\lbrace e_1, e_2 \rbrace$ for clarity, is a basis for $R$ as a module, the relation $r_1 \cdot e_1 + r_2 \cdot e_2 = 0$ implies $r_1 = r_2 = 0$ if $R$ is free. But we just showed that this isn't the case.