Question about the set of all $\mathfrak p\in\operatorname{Spec}R$ such that $M_{\mathfrak p}=0$. Is the following subset of $\operatorname{Spec}(R)$ always open?  $R$ is a commutative, unitary ring and $M$ is an $R$-module.$$\{\mathfrak p \in\operatorname{Spec}(R) \colon M_{\mathfrak p} = 0\}$$

It is not necessarily open for $R$-modules that are not finitely generated. For example, let $R=\mathbb Z$ and $M=\bigoplus_p\mathbb Z/(p)$ ranging over the prime numbers $p\in\mathbb Z$. Since localization commutes with direct sums, we have that if $\mathfrak p$ is a prime ideal, then $M_\mathfrak p=0$ if and only if $(\mathbb Z/(q))_{\mathfrak p} = 0$.
Let $\mathfrak p = (p)$ is a nonzero prime ideal. $(\mathbb Z/(p))_{\mathfrak p}=\mathbb Z/(p)$ is nonzero, so $M_\mathfrak p$ is nonzero.
However, if $\mathfrak p = (0)$, then in $(\mathbb Z/(p))_{\mathfrak p}$ we have $1/1=p/p=0/1$. As a result $M_{(0)}=0$.
Taking stock, the set $\{\mathfrak p\in\operatorname{Spec}\mathbb Z\colon M_\mathfrak p=0\}=\{(0)\}$ is not open, since any open sets in $\operatorname{Spec}\mathbb Z$ is either infinite or empty.
