Showing that $\mathbb Q$ is not a direct product of groups Problem: From Aluffi's Algebra: Chapter 0, Chapter II

3.5. Prove that $\mathbb Q$ is not the direct product of two nontrivial groups.

My attempt at a proof: Suppose $\mathbb Q\cong G\times H$ for some nontrivial groups $G$ and $H$. Let
$$\mathbb Q\ni 1\leftrightarrow(g, h)\in G\times H.$$
Choose a $(x, y)\in G\times H$ such that $x\ne e_G$ and $y\ne e_H$. Say
$$
(x, e_H)\leftrightarrow a/b\quad\text{and}\quad (e_G, y)\leftrightarrow c/d\text.
$$
Then
$$
(x, e_H)^b\leftrightarrow a\leftrightarrow(g, h)^a
$$
which means that
$
(x, e_H)^b = (g, h)^a
$
and hence
$h^a = e_H$. Similarly, $g^c = e_G$. Now if $a$ and $c$ are both nonzero, then $|(g, h)| < \infty$ in $G\times H$ which will mean that $|1| < \infty$ in $\mathbb Q$ which is false. Hence $a = 0$ or $c = 0$. This means that
$$(x, e_H)\leftrightarrow 0\quad\text{or} \quad (e_G, y)\leftrightarrow 0$$
which means that $x = e_G$ or $y = e_H$ since $0\leftrightarrow (e_G, e_H)$. This is the required contradiction. $\square$
Question: This seems like an overly complicated and artificial proof, as if there has to be a simpler and more elegant way here. Can you think of any?
Note: Aluffi covers only the very basic group theory until this point, hence the use of more advanced stuff is not allowed.
 A: 
Question: This seems like an overly complicated and artificial proof, as if there has to be a simpler and more elegant way here. Can you think of any?

Sure. If $\mathbb{Q}\simeq G\times H$ then $\mathbb{Q}$ has two nontrivial subgroups $A,B\subseteq\mathbb{Q}$ such that $A\cap B=\{0\}$. But that cannot happen since any two non-zero rationals have a common multiple.

EDIT: According to comments you have not been introduced to subgroups yet. Which btw is weird to introduce homomorphisms before subgroups. But, hey, who am I to judge?
Anyway, if that's the case, then the argument above can be rewritten as follows: consider an isomorphism $f:G\times H\to\mathbb{Q}$ and consider nontrivial $g\in G$ and nontrivial $h\in H$. Then $f(g,e_H)$ and $f(e_G, h)$ are nonzero rationals and so they have a common nonzero multiple. The preimage of that common multiple has to belong to both $G\times\{e_H\}$ and $\{e_G\}\times H$ at the same time, and so it is $(e_G,e_H)$, which cannot happen, because $f(e_G,e_H)=0$.
Note that this is very similar to your reasoning though. I've just omitted few details to make the proof easier to read.
A: I came up with a nice proof. I don't know how to use LaTeX well, I'm just going to write this the best I can.
Q has the following property:
For any q belonging to Q we have that there exist some non-zero integer n such that nq is an integer, which means that there exist some integer m such that
n.q = m.1
Now suppose that Q is isomorphic to the direct product of two non-trivial groups A and B.
All non-identity elements of both A and B have infinite order, otherwise we could construct a non-identity element of AxB with finite order, which is a contradiction since AxB is isomorphic to Q.
Now, as AxB is isomorphic Q, it must have this special property stated above, therefore there exist some element (a, b) of AxB which have the following property:
For every (x, y) in AxB there exist some integers n and m with n non-zero satisfying the following:
n.(x, y) = m.(a, b)
(nx, ny) = (ma, mb)
Which implies
nx = ma and ny = mb
Now, let x = 0 and y =/= 0
This gives us ma = 0, but a does not have finite order, so m = 0
But this gives us ny = 0 and n is non-zero, therefore y has finite order, a contradiction.
Therefore, Q cannot be isomorphic to the direct product of non-trivial groups
