Central product need not preserve powering

Statement
It is possible to have a group $$G$$ that is an internal central product of subgroups $$H$$ and $$K$$ that are both powered over a prime number $$p$$ but such that $$G$$ is not powered over $$p$$.

Proof
Let $$G$$ be the external direct product of the (additive) group of rational numbers $$\mathbb{Q}$$ and the group of rational numbers modulo integers $$\mathbb{Q}/\mathbb{Z}$$. In other words, we have:

$$G = \mathbb{Q} \times \mathbb{Q}/\mathbb{Z}$$

Consider the subgroups $$H$$ and $$K$$ defined as follows:


 * $$H = \{ (a,0) \mid a \in \mathbb{Q} \}$$ is the first direct factor.
 * Let $$\pi:\mathbb{Q} \to \mathbb{Q}/\mathbb{Z}$$ be the natural quotient map. Define:

$$K = \{ (a,\pi(a)) \mid a \in \mathbb{Q} \}$$.

Now, the following are true:


 * $$G$$ is an internal central product of $$H$$ and $$K$$.
 * Both $$H$$ and $$K$$ are powered over all primes.
 * $$G$$ is not powered over any prime, because it has torsion elements for all primes on account of its second direct factor.