I have a question about proposition 19.6 of Lam in his book "Lectures on Modules and Rings (1999)", on page 507-508. The proposition is about cogenerators of $\mbox{Mod}_R$. The proposition is as follows:
For $U_R\in \mbox{Mod}_R$, the following are equivalent:
(1) $U$ is a cogenerator.
(2) For any $N\in \mbox{Mod}_R$ and $0\neq x\in N$ there exists $g:N\to U$ such that $g(x)\neq0$.
(3) Any $N\in \mbox{Mod}_R$ can be embedded into some direct product $\Pi _i U$.
Lam gives this proof of (2) $\Rightarrow$ (3)
For any $0\neq x\in N$, fix $\pi _x : N\to U$ with $\pi _x (x)\neq 0$. Then $\pi = (\pi _x)$ gives an embedding of $N$ into $\Pi_{x\neq 0} U$.
But I fail to see that this is an embedding, i.e., an injection. Can anybody help me ?
Let $y\in N$ be nonzero. If $\pi(y)=0$, that means $\pi_x(y)=0$ for all nonzero $x\in N$. But you can choose $x=y$, and then $\pi_x(y)\neq 0$ by definition. So $\pi(y)\neq 0$.