Claim: Suppose $M$ is the internal direct sum of $M_1 , \ldots , M_n \;$. $M$ is a finitely generated $R$-module iff $M_1 , \ldots , M_n $ are finitely generated $R$-modules.
Here $M$ is a $R$-module, where $R$ is commutative, and $M_1, \ldots , M_n$ are all submodules of $M$.
I understand that being an internal direct sum means $M=\sum M_i$ where $M_j \; \cap \; (\sum_{i=j} M_i) = \{0\}$ or in other words $x_1 + x_2 + \ldots + x_n = 0$ only when all $x_i \in M_i$ chosen are $0$.
Additionally, I know ,that being finitely generated means we can express an element of $M$ using a generating set, call it $\{a_1 , a_2 , \ldots , a_n\}$.
My attempt was to simply consider the generating set to be $\{x_i\}$, where $x_i \in M_i$ and then consider a map, but I am not sure how to proceed. My thought is that any element of $m \in M$ can be written as $m= x_1 + x_2 + \ldots + x_n$