Here's an ugly argument that I know of (which works for abelian groups, and so I assume it works over arbitrary PID). You need to make three observations:
- Maximal cyclic $p$-submodules of a $p$-module $M$ are the direct summands of $M$.
- Every cyclic $p$-submodule of $M$ is contained in a maximal cyclic $p$-submodule.
- If $N_1\subset M_1$ and $N_2\subset M_2$ are cyclic $p$-submodules of $M$, then $M_1$ and $M_2$ are disjoint if and only if $N_1$ and $N_2$ (this follows from observing that the submodules of a cyclic $p$-module are totally ordered under inclusion, and considering where $M_1\cap M_2$ is relative to $N_1$ and $N_2$ as a submodule of $M_1$ or $M_2$; you may have to use the fact that cyclic $p$-modules are indecomposable).
Once you have proven those, take a direct sum decomposition of $N$ into cylic $p$-submodules $N_1\oplus N_2\oplus\dots\oplus N_i$ (which exists by structure theorem of finitely generated modules over a PID), and use 1., 2. and 3. to obtain a decomposition M=M_1\oplus\dots M_n\oplus M', where $M_i$ is the maximal cyclic $p$-submodule that contains the cyclic $p$-submodule $N_i$.
*by $p$-module I mean a module annihilated by some power of the prime $p$ in the PID $R$ (it's the primality of $p$ that matters, not irreducibility, for the total ordering of submodules, though the two coincide over PIDs, which is where you need to be anyway for the structure theorem to work)