Motivation + Problem: While doing some exercises in Aluffi's Algebra: Chapter 0, I came across a problem which asks the reader to prove that ${\mathbb Q}$ is not the product of two nontrivial groups. This is the standard product in the category of groups.
My Question: Since the chapter delves into categorical arguments, I tried it this way. We suppose not, that ${\mathbb Q} \cong G\times H$ and note that for any group $Z$ and any appropriate mappings $f,g$, we have the following diagram (sorry for the awkward TeXing, xypic doesn't seem to work here...),
$\displaystyle \begin{array}{ccccc} & & Z & & \\ & ^{f}\swarrow & \downarrow&_{\exists!\langle f,g\rangle} \searrow^{g} & \\ & G\longleftarrow_{\pi_{1}} & {\mathbb Q} & _{\pi_{2}}\longrightarrow H &\end{array}$
So, we find that there is always a unique mapping in the center if this is a product. The projections either inject an isomorphic copy of ${\mathbb Q}$ or are the zero mapping. We'd like to show that either $G$ or $H$ is trivial. I'm not sure how to show that at least one must be trivial.
My Attempt: Suppose $G \neq \{0\}$. We need to show $H = \{0\}$. Letting $Z = G$ and let $f = id$, we find that $G \cong {\mathbb Q}$. Moreover, the unique map in the center must be some multiplication mapping (which takes $x\mapsto qx$ for rational $q$; this is because $\pi_{1}$ must be a multiplication mapping if it is not the zero mapping). My guess here is that if $H$ is not trivial, it must also be an isomorphic copy of ${\mathbb Q}$ and we can allow $g$ to be some multiplication map like above such that the unique center mapping does not allow the right-hand triangle to commute.
Does this sort of argument work?