Solution (source code)

= Solution

Localization of the inclusion $N\hookrightarrow M$ gives an injection $S^{-1}N\hookrightarrow S^{-1}M$, whose image lies in $N'$. Conversely, take $m/s\in N'$. Since $s/1$ is a unit and $N'$ is an $S^{-1}A$-submodule,
$$
\frac m1=\frac s1\frac ms\in N'.
$$
By the definition of the inverse image, $m\in N$, and hence $m/s$ lies in the image of $S^{-1}N$. Therefore
$$
\boxed{N'\simeq S^{-1}N.}
$$