Let $R$ be a local ring with maximal ideal $\mathfrak{m}$ and let $M$ be an $R$-module. For a prime ideal $\mathfrak{p}\in R$, $M_p$ shall denote the localization of $M$ at $p$.
I've read the following and I can't see why it's true:
If $M_p=0$ for any prime ideal in $R$ that is distinct from $\mathfrak{m}$, then $M$ is a module of finite length.
I just know that if $M_m=0$ as well, that $M=0$.
Hint: Show that for any $m\in M$, $\text{Ann}_R(m)$ is not contained in any non-maximal prime - consider what it means for $m$ to map to $0$ in $M_{\mathfrak p}$ for that. Deduce that there exists $l\gg 0$ (depending on $m$) such that ${\mathfrak m}^l m = \{0\}$ (note that $Rm\subset M$ is a module over $R/\text{Ann}_R(m)$, which is Artinian local by the first step). Finally, using finite generation of $M$ conclude that there's some $l\gg 0$ such that ${\mathfrak m}^l M = 0$, and build a finite filtration from that.