# Element separated from a submodule by a homomorphism

Let $M$ be a module over a commutative ring $A$, $M'$ a submodule, and $y\in M\setminus M'$. Then $y$ can be separated from $M'$ by homomorphism.

What I wish to prove is that there exists an $A$-module $N$ and an $A$-module homomorphism $f:M\to N$ s.t. $f(M')=0$, but $f(y)\neq 0$. If I was given a basis for $M$, I see how this could be done, but I'm struggling to prove it for arbitrary modules.

The reason why I want to prove this is because in Atiyah and MacDonald's Commutative Algebra textbook (chapter 2), they state that if $v:M\to M''$ is a homomorphism such that the induced homorphism $\bar{v}:\mathrm{Hom}(M'',N)\to\mathrm{Hom}(M,N)$ is injective $\forall$ $A$-modules $N$, then $v$ must be surjective, but I'm struggling to prove this.

Hint: Take $f:M\rightarrow M/M'$ be the canonical projection.
This is true for the canonical surjective homomorphism $f:M\to M/M'$ simply because $y$ is not in the kernel.