Examples of maps $\phi: \operatorname{Hom}(\prod_s N_s, M) \to \prod_s \operatorname{Hom}(N_s, M)$ Let $R$ be a commutative ring, $\{N_s\}_{s \in S}$ is a family of modules and $M$ is a module over $R$. There is canonical map of modules
$$
\phi: \operatorname{Hom} \bigg(\!\prod_s N_s, M \bigg) \to \prod_s \operatorname{Hom}(N_s, M),
$$
that sends map $f \colon \prod_s N_s \to M$ to the "infinite vector" of maps $(f\circ \iota_k)_s$, where $\iota_k\colon N_k \to \prod_s N_s$ is the canonical injection. It is well-known that this map is isomorphism if $\prod_s N_s$ is replaced by $\bigoplus_s N_s$. But I want to know examples when product version fails to be injective or surjective.
I'm interested in the following examples in order of preferences

*

*Ring $R$ is a field and $\phi$ is neither injective nor surjective.


*Ring $R$ is a field and $\phi$ is not injective (surjective).


*Map $\phi$ is neither injective nor surjective.


*Map $\phi$ is not injective (surjective).
If there are theorems that forbid examples of any of the above types, it is also very interesting.
 A: Equivalently, you are asking about the restriction map  $\operatorname{Hom}(P, M) \to \operatorname{Hom}(Q, M)$ induced by the inclusion map $Q\to P$ where $P=\prod_s N_s$ and $Q=\bigoplus_s N_s$.  This map is part of an exact sequence $$0\to \operatorname{Hom}(P/Q,M)\to\operatorname{Hom}(P,M)\stackrel{\phi}\to\operatorname{Hom}(Q,M)\to \operatorname{Ext}^1(P/Q,M)\to \operatorname{Ext}^1(P,M).$$  So, $\phi$ is injective iff there are no nontrivial homomorphisms $P/Q\to M$.  In particular, for instance, this means that $\phi$ is never injective when $R$ is a field as long as infinitely many of the $N_s$ are nontrivial and $M$ is nontrivial.  Or, for an arbitrary family where infinitely many of the $N_s$ are nontrivial, if $M=P/Q$ then $\phi$ will not be injective.  On the other hand, if $M$ is an injective module (so in particular, if $R$ is a field, or more generally if $R$ is a semisimple ring), then $\phi$ is always surjective.
For an example where $\phi$ is not surjective, you could take $R=\mathbb{Z}$ and consider the direct product $P=\prod_p\mathbb{Z}/(p)$ where $p$ ranges over the primes.  Note that then the quotient $P/Q$ is divisible: given an element $x\in P$ and a nonzero integer $n$, you can divide $x$ by $n$ mod $Q$ by just ignoring the coordinates corresponding to the finitely many primes dividing $n$.  But $P$ has no nontrivial divisible submodules, since if $x\in P$ is nonzero on its $p$th coordinate then $x$ is not divisible by $p$.  So in particular, $P/Q$ is not isomorphic to a submodule of $P$ so the inclusion map $Q\to P$ does not split.  Taking $M=Q$, this says exactly that $\phi$ fails to be surjective since its image does not contain the identity map $Q\to Q$.
To get an example where $\phi$ is neither surjective nor injective, you can just take a direct sum of examples of each type.  For instance, with the same product as in the previous example, you could take $M=Q\oplus P/Q$.
Another well-known example where $\phi$ is not surjective is if you take $R=\mathbb{Z}$ and $P$ to be a product of countably infinitely many copies of $\mathbb{Z}$.  Then it is a nontrivial theorem that every homomorphism $P\to\mathbb{Z}$ is a linear combination of the projection maps.  In particular, there are only countably many such maps, whereas there are uncountably many homomorphisms $Q\to\mathbb{Z}$ (since $Q$ is free on infinitely many generators), so the restriction map $\phi:\operatorname{Hom}(P,\mathbb{Z})\to\operatorname{Hom}(Q,\mathbb{Z})$ is very far from surjective.  (On the other hand, it follows from the theorem that $\phi$ is injective in this case, which is rather surprising.)
