If $R$ is a Noetherian (commutative) ring and $M$ is a finitely generated $R$-module, then what choice of nonzero ideal $I$ of $R$ is such that $M_P$ is a free $R_P$-module for any prime $P$ in $R$ such that $P+I=R$?
My idea is to write $M$ as a quotient of a free module, say $R^n/N$, and then let $I=Ann(M)$. I think this means $N_P=0$ for any $P$ as stated, which means $M_P$ is free, but does this $I$ have to be nonzero?
Many thanks for any help with this!
The set $U=\{P\in\operatorname{Spec}(R):M_P \text{ is free}\}$ is open in $\operatorname{Spec}(R)$ (for a proof see here), so there is an ideal $J$ such that $U=\operatorname{Spec}(R)-V(J)$. If $J=(0)$, then $U=\emptyset$ and can take $I=R$; if $J\ne (0)$, take $I=J$.