Let $R$ be a commutative ring, $J$ denote the Jacobson radical of $R$. Let $M$ be an $R$-module, my question is:
Is $M=mM$ for all maximal ideal $m$ of $R$ if and only if $M=JM$.
It is clear that if $M=JM$, then $M=mM$ for all maximal ideal.
If $M$ is finite generated, suppose $M=mM$, for all maximal ideal. We know $M_m$ is finite generated $R_m$-module, hence we know $M_m=0$ by Nakayma since $M_m=mR_m M_m$. So we know $M=0$ since $M_m=0$ for all maximal ideal of $R$. So if $M$ is finite generated, the question is true.
Thank you in advance.
No, this is false without some additional assumptions on $R$ or $M$.
Obviously $\mathbb{Q} = n \mathbb{Q}$ for any $0 \not= n \in \mathbb{Z}$, and in particular for any prime $p$, but the Jacobson radical of $\mathbb{Z}$ is $0$.
Below are some additional thoughts on your post. For convenience I will label the asked-about implication
$$M = \mathfrak{m}M \; \forall \mathfrak{m} \in \operatorname{maxSpec}(R) \implies M = JM\tag{$*$}$$
To continue with the observation in your post about finitely generated modules, there are some more notable cases on $M$ or $R$ where $(*)$ is incidentally valid because $M = \mathfrak{m}M$ for all maximal ideals already implied that $M$ vanished.
For one, the behavior of projective modules is the same as what you noted about (locally) finite modules in your post: for a projective module $M$ and a prime $\mathfrak{p}$, we again have $M_\mathfrak{p} = 0$ iff $M = \mathfrak{p}M$ (now the reasoning stems from $M_\mathfrak{p}$'s being free, as opposed to from NAK). So again your condition would imply that projective modules vanish. Contrast this to the counterexample I gave which featured an injective module (and even over a PID).
Another way this happens is when $R$ is Von Neumann Regular. In this case $M=\mathfrak{p}M$ implies $M_\mathfrak{p}$ because $\mathfrak{p}R_\mathfrak{p} = 0$.
This last observation illuminates the unsurprising fact that
(equivalently characterized as $R/J(R)$ being $0$-dimensional in the sense of Krull). Of course a special case of this is when $R$ is semi-local.