Do profinite completions commute with direct products? I am trying to prove that
$$\widehat{\mathbb{Q}}_p^\times\cong\widehat{\mathbb{Z}}\times\mathbb{Z}_p^\times,$$
where $\widehat{G}$ denotes the profinite completion of a group $G$. Using $\mathbb{Q}_p^\times\cong\mathbb{Z}\times\mathbb{Z}_p^\times$, this would be easy if profinite completion commuted with (at least finite) direct products, but is this true?
I have not been able to find a reference for the validity/falsity of that fact and have trouble proving it mainly because there is not really an easy description of the subgroups of $G\times H$ in terms of the subgroups of $G$ and $H$.
EDIT: Here is my attempt at a proof of this at least for abelian groups $G, H$ (is it correct?):
We claim that $\widehat{G}\times\widehat{H}$ satisfies the universal property of the profinite completion of $G\times H$. Namely, let $N$ be any normal subgroup of $G\times H$ of finite index. By Goursat's lemma, there are subgroups $G_2\unlhd G_1\leq G$ and $H_2\unlhd H_1\leq H$ and an isomorphism $\phi: G_1/G_2\rightarrow H_1/H_2$ such that
\begin{equation*}
N=\{(g, h)\in G_1\times H_1: \phi(gG_2)=hH_2\}.
\end{equation*}
Notice that $N$ has index $|G_1/G_2|=|H_1/H_2|$ in $G_1\times H_1$ and $G_1\times H_1$ has index $[G:G_1][H:H_1]$ in $G\times H$; hence, as $[G\times H: N]$ is finite, we must have that $[G:G_2]$ and $[H:H_2]$ are finite. In particular, $N$ contains $G_2\times H_2$. Using the projections from $\widehat{G}$ and $\widehat{H}$ to $G/G_2$ and $H/H_2$, respectively, we obtain a morphism $\widehat{G}\times\widehat{H}\rightarrow (G\times H)/(G_2\times H_2)$ and by composition with the canonical projection a morphism $\phi_N$ into $(G\times H)/N$. It is easy to see that $\phi_N$ does not depend on the choice of subgroups $G_2, H_2$ with finite index in $G, H$ such that $G_2\times H_2\leq N$ and hence it follows that the $\phi_N$ are compatible with the projections among the $(G\times H)/N$.
Now let $Z$ be a group with morphisms $f_N: Z\rightarrow (G\times H)/N$ for any normal subgroup $N$ of finite index such that the $f_N$ are compatible with the projections between the groups $(G\times H)/N$. Then any morphism $f: Z\rightarrow \widehat{G}\times\widehat{H}$ such that $\phi_N\circ f=f_N$ induces a morphism $f_G: Z\rightarrow\widehat{G}$ compatible with the maps $Z\rightarrow (G\times H)/(N_G\times H)\cong G/N_G$ and $\widehat{G}\rightarrow G/N_G$ for $N_G$ normal in $G$ with finite index and thus $f_G$ is unique by the universal property of the profinite completion. Analogously, $f_H$ is unique, so $f$ is unique.
Conversely, again by the universal property of the profinite completion, we obtain a morphism $f_G: Z\rightarrow\widehat{G}$ compatible with the maps $Z\rightarrow (G\times H)/(N_G\times H)\cong G/N_G$ and $\widehat{G}\rightarrow G/N_G$ for $N_G$ normal in $G$ with finite index and analogously a morphism $f_H$. We claim that the morphism $f: Z\rightarrow\widehat{G}\times\widehat{H}$ obtained by putting them together satisfies $\phi_N\circ f=f_N$ for $N$ normal in $G\times H$ of finite index. Namely, by the above, any such $N$ contains a subgroup $N_G\times N_H$ for $N_G, N_H$ normal in $G, H$ of finite index and we know that $\phi_{N_G\times N_H}\circ f=f_{N_G\times N_H}$ by construction of $f$. The equality $\phi_N\circ f=f_N$ then follows by composing both sides with the projection $(G\times H)/(N_G\times N_H)\rightarrow (G\times H)/N$ on the left.
 A: Yes, profinite completion commutes with finite products. Rather than wondering what a subgroup of the product group looks like, it's easier to verify the universal property directly.
The basic idea is that although a product is of course a limit and not a colimit, in the category of groups, there's still a nice way to describe morphisms out of a product: these are just pairs of morphisms commuting pointwise. More precisely, there's a natural bijection
$$\mathrm{Hom}_{\mathbf{Grp}}(G \times H,K)\\ \cong \{(f,g) \in \mathrm{Hom}_{\mathbf{Grp}}(G,K) \times \mathrm{Hom}_{\mathbf{Grp}}(H,K) \mid \forall x \in G\ \forall y \in H: f(x)g(y)=g(y)f(x) \}$$
The same also holds in the category of topological groups.
Using this, we prove that $\widehat{G} \times \widehat{H}$ satisfies the universal property of the profinite completion. Let $K$ be a profinite group and let $f:G \times H \to K$ be a group homomorphism. Then $f$ corresponds to a pair $(g,h) \in \mathrm{Hom}_{\mathbf{Grp}}(G,K) \times \mathrm{Hom}_{\mathbf{Grp}}(H,K)$ as above. By the universal property of profinite completions, we obtain group homomorphisms $\widehat{g}:\widehat{G} \to K$ and $\widehat{h}:\widehat{H} \to K$. Note that these homomorphisms satisfy $$\forall \widehat{x} \in \widehat{G}\ \forall \widehat{y} \in \widehat{H}:\widehat{g}(\widehat{x})\widehat{h}(\widehat{y})=\widehat{h}(\widehat{y})\widehat{g}(\widehat{x})$$
Indeed, this may be proved by taking nets $(x_i)_{i \in I}, (y_j)_{j \in J}$ in $G$ and $H$ respectively such that $x_i$ converges to $\widehat{x}$ and $y_j$ converges to $\widehat{y}$. Then $(g(x_i)h(y_j))_{(i,j) \in I \times J}$ converges to $\widehat{g}(\widehat{x})\widehat{h}(\widehat{y})$. But we have $g(x_i)h(y_j)=h(y_j)g(x_i)$ for all $i,j$, so it also converges to $\widehat{h}(\widehat{y})\widehat{g}(\widehat{x})$. As limits of nets in a Hausdorff space are unique, we get $\widehat{g}(\widehat{x})\widehat{h}(\widehat{y})=\widehat{h}(\widehat{y})\widehat{g}(\widehat{x})$ as claimed.
Thus we obtain a morphism of topological groups $\widehat{G} \times \widehat{H} \to K$ that makes the necessary triangle commute. Because the image of $G \times H$ in $\widehat{G} \times \widehat{H}$ is dense and $K$ is Hausdorff, this homomorphism is unique. Thus $\widehat{G} \times \widehat{H}$ satisfies the universal property of profinite completion and we get
$$\widehat{G} \times \widehat{H} \cong \widehat{G \times H}$$
as desired.
