A homomorphism $M \to N$ is surjective iff $M_\mathfrak{p} \to N_\mathfrak{p}$ is surjective for all $\mathfrak{p} \in \mathrm{Spec}(R)$ iff… Given a $R$-module homomorphism $f \colon M\rightarrow N$, I want to show that the three following properties are equivalent:

*

*$f \colon M \rightarrow N$ is surjective.

*$f_\mathfrak{p}\colon M_\mathfrak{p} \rightarrow N_\mathfrak{p}$ is surjective for all $\mathfrak{p} \in \operatorname{Spec}(R)$.

*$f_\mathfrak{m}\colon M_\mathfrak{m} \rightarrow N_\mathfrak{m}$ is surjective for all $\mathfrak{m} \in \operatorname{Spm}(R)$.

My thoughts: if we assume 1), then for any multiplicative subset $S$ of $R$, we have that
$$
  \mathrm{id}_{S^{-1}R} \otimes_R f \colon S^{-1}R \otimes_R M \rightarrow S^{-1}R \otimes_R N
$$
is surjective since the tensor product is right-exact.
Then, using that $S^{-1}R \otimes_R M \cong S^{-1}M$, $S^{-1}R \otimes_R N \cong S^{-1}N$, and taking $S:=R \setminus \mathfrak{p}$ and $S:=R \setminus \mathfrak{m}$, we should have 1) $\rightarrow$ 2) and 1) $\rightarrow$ 3) respectively? Not sure if my reasoning is correct. Also 2) should imply 3) since maximal ideals are prime…
Some help/hints would be appreciated for the other implications.
 A: Your proof of $1)\to2) $ is correct. So we only should proof $3)\to 1)$.
First you take cokernel  $\operatorname{Coker}(f)$, we have exact sequence

$M\to N\to \operatorname{Coker}(f)\to 0$.

Then we take localization at maximal ideals ${\frak m}$, by (3) we have that $(\operatorname{Coker}(f))_{\frak m}=0$ for all $\frak{m}$. But this means $\operatorname{Coker}(f)=0$ because of the following lemma.

For a $R$-module $M$, if $M_{\frak m}=0$ for all maximal ideals $\frak{m}$, we have $M=0$.

proof. If $M\neq  0$ we take non $0$ element $m\in M$. Then  $Ann(x)\subset R$ is not $(1)$, there is a maximal ideal ${\frak m}$ which contains $Ann(x)$. But because of $x=0\in M_{\frak m}$,  there is an elements $s\notin {\frak m}$ s.t.$sx=0$ which is contradiction of $Ann(x)\subset {\frak m}$.
A: Everything you wrote (for 1 → 2 → 3) seems correct to me. To complete and generalize:
even if $f$ is not surjective, whe have

*

*$N_m/\mathrm{Im}f_{\mathfrak m}\cong(N/\mathrm{Im}f)_{\mathfrak m}$ for any maximal ideal $\mathfrak m$ in $R$ and similarly (with the same proof) for any prime ideal;

*$\begin{align}N/\mathrm{Im}f=0&\iff\forall\mathfrak p\in Spec(R)\quad(N/\mathrm{Im}f)_{\mathfrak p}=0\\&\iff\forall\mathfrak m\in Specm(R)\quad(N/\mathrm{Im}f)_{\mathfrak m}=0.\end{align}$
