For an $R$-module $M$, and an ideal $I$ of $R$, does $IM=M$ imply $I=R$?

Let $R$ be a commutative ring. Let $M$ be an $R$-module and $I\subseteq R$ an ideal. In Nakayama's Lemma and in a number of situations we have the condition $IM=M$. I was wondering if this automatically implies $I=R$ or $M=0$, or if there are any counter-examples?

Obviously $I \nsubseteq J$ should hold with $J$ the Jacobson-radical of $R$, since otherwise we have $M=0$. I was unable to come up with anything, but maybe that is because I am not using any complicated enough rings (non-noetherian etc.). Can anyone provide any counter examples?

EDIT: I am asking this because I need to show $IM=M$ in an exercise, and I am trying to get a better understanding of what this condition means for $I$.


Solution 1:

Many counterexamples, like $R=\mathbb{Z}$, $I=(2)$, $M=\mathbb{Q}$, etc

The main fact that you can use to get positive results is

$M$ finitely generated, $IM = M$ implies there exists $i\in I$ such that $im = m$ for all $m\in M$.