Maps to all finite cyclic groups factor implies map to integers factors Let $G$, $H$ be groups (we lose nothing here if we assume they're abelian), let $f:G\to H$ and $g:G\to \mathbb{Z}$ be homomorphisms. This last map gives us homomorphisms $g_n:G\to {\mathbb{Z}}/{n \mathbb{Z}}$ for each positive integer $n$, by composing with the usual quotient.
Now suppose that for every $n$, the map $g_n$ factors through $H$ in the sense that there is some homomorphism $h_n:H\to{\mathbb{Z}}/{n \mathbb{Z}}$ with $g_n=h_n \circ f$.
This clearly happens if $g$ itself factors (there's some $h:H\to\mathbb{Z}$ with $g=h\circ f$), but is the converse true? If all the $g_n$ factor, does it follow that $g$ factors?
 A: The converse seems to be false.  Let $G=\mathbb{Z}$, and let $g$ be the identity morphism.  Let $H$ be the group $\prod_{n\in \mathbb{N}}\mathbb{Z}/n\mathbb{Z}$, and let $f:G\to H$ be the morphism sending each $m$ to the element of $H$ whose $n$-th coordinate is the image of $m$ in $\mathbb{Z}/n\mathbb{Z}$ by the natural projection.  Then each $g_n$ factors through $H$: it is the composition of $f$ with the canonical projection from $H$ to its $n$-th direct factor; indeed, the composition $$ \mathbb{Z}\stackrel{f}{\to} \prod_{n\in \mathbb{N}}\mathbb{Z}/n\mathbb{Z} \to \mathbb{Z}/n\mathbb{Z} $$ is then the natural projection from $\mathbb{Z}$ to $\mathbb{Z}/n\mathbb{Z}$, which is equal to $g_n$ by definition.
However, $g$ itself does not factor through $H$.  Indeed, there are no non-zero morphisms from $H=\prod_{n\in \mathbb{N}}\mathbb{Z}/n\mathbb{Z}$ to $\mathbb{Z}$.  To see this, consider the morphism $\prod_{n\in \mathbb{N}}\mathbb{Z}\to \prod_{n\in \mathbb{N}}\mathbb{Z}/n\mathbb{Z}$ given by the componentwise projection.  The composition $$\prod_{n\in \mathbb{N}}\mathbb{Z}\to \prod_{n\in \mathbb{N}}\mathbb{Z}/n\mathbb{Z} \to \mathbb{Z}$$ would be a morphism whose kernel contains $\bigoplus_{n\in \mathbb{N}}\mathbb{Z}$.  By a theorem of Specker (see, for instance, answers to this question), this implies that the composition is zero.  The left morphism being surjective, this in turn implies that any morphism $\prod_{n\in \mathbb{N}}\mathbb{Z}/n\mathbb{Z} \to \mathbb{Z}$ vanishes.
This proves that $g$ does not factor through $H$ in this example.
