Solution (source code)

= Solution

If $M$ is irreducible and $m\ne0$, the image $Rm$ is a nonzero submodule, hence $Rm=M$ and the map is onto. Conversely, if every nonzero $m$ is cyclic and $N\leq M$ is nonzero, choose $m\in N\setminus\{0\}$. Then $M=Rm\subseteq N$, so $N=M$ and $M$ is irreducible.