TITLE: Is $\operatorname{Hom}_\mathbb{Z}(\mathbb{Q},\mathbb{Q}/\mathbb{Z})\cong\bigoplus_p\mathbb{Q}_p$?
QUESTION [11 upvotes]: Is $\operatorname{Hom}_\mathbb{Z}(\mathbb{Q},\mathbb{Q}/\mathbb{Z})\cong\bigoplus_p\mathbb{Q}_p$? Or maybe $\prod_p\mathbb{Q}_p$?
I know $\mathbb{Q}/\mathbb{Z}\cong\bigoplus_p \mathbb{Z}_{p^\infty}$, and also that $\operatorname{Hom}(\mathbb{Q},\mathbb{Z}_{p^\infty})\cong\mathbb{Q}_p$. So I want to say
$$
\operatorname{Hom}_\mathbb{Z}(\mathbb{Q},\mathbb{Q}/\mathbb{Z})\cong\operatorname{Hom}_\mathbb{Z}(\mathbb{Q},\bigoplus_p\mathbb{Z}_{p^\infty})\cong\bigoplus_p\operatorname{hom}(\mathbb{Q},\mathbb{Z}_{p^\infty})\cong\bigoplus_p\mathbb{Q}_p
$$
However, I'm not sure about the middle isomorphism. I only know of rules which allow one to pull a coproduct in the first term out into the front of Hom and change it to a product, or you can pull a product in the second term out into the front of Hom as a product. 
Some digging here seems to imply that one cannot generally pull a direct sum in the second term out in front as a product, ans this is an isomorphism if the first term is finitely generated, but $\mathbb{Q}$ is certainly not a f.g. $\mathbb{Z}$-module.

REPLY [4 votes]: From this answer, we know that
$$\hom(\mathbb{Q}/\mathbb{Z}, \mathbb{Q}/\mathbb{Z}) \cong \hat{\mathbb{Z}} \cong \prod_p \mathbb{Z}_p$$
We can therefore compute the long exact sequence
$$ 0 \to \hom(\mathbb{Q}/\mathbb{Z}, \mathbb{Q}/\mathbb{Z})
\to \hom(\mathbb{Q}, \mathbb{Q}/\mathbb{Z})
\to \hom(\mathbb{Z}, \mathbb{Q}/\mathbb{Z})
\to \operatorname{Ext}^1(\mathbb{Q}/\mathbb{Z}, \mathbb{Q}/\mathbb{Z})
\to \ldots
$$
to be the short exact sequence
$$ 0 \to \hat{\mathbb{Z}} \to \hom(\mathbb{Q}, \mathbb{Q}/\mathbb{Z})
\to \mathbb{Q} / \mathbb{Z} \to 0$$
The first map is given by
$$x \mapsto \left(\frac{m}{n} \mapsto \frac{x'm}{n} \right)
\qquad \qquad (x' \equiv x \bmod n)$$ 
and the second is
$$ f \mapsto f(1) $$
Furthermore, $\hom(\mathbb{Q}, \mathbb{Q}/\mathbb{Z})$ is a $\mathbb{Q}$-vector space; the action of $q$ on the function $f$ gives the function $(q \cdot f)(x) = f(qx)$, so the tensor product with $\mathbb{Q}$ gives an exact sequence
$$ 0 \to \mathbb{Q} \otimes \hat{\mathbb{Z}} \to \mathbb{Q} \otimes \hom(\mathbb{Q}, \mathbb{Q}/\mathbb{Z}) \to \mathbb{Q} \otimes \mathbb{Q}/\mathbb{Z} \to 0$$
which simplifies to
$$ \mathbb{Q} \otimes \hat{\mathbb{Z}} \cong \hom(\mathbb{Q}, \mathbb{Q}/\mathbb{Z})$$