Question:Subgroup of direct product direct product of subgroups

Q: '''Consider the external direct product $$G_1 \times G_2$$. Is every subgroup of this of the form $$H_1 \times H_2$$ where $$H_1$$ is a subgroup of $$G_1$$ and $$H_2$$ is a subgroup of $$G_2$$, embedded in the obvious way inside $$G_1 \times G_2$$?'''

A: Not in general. In particular, if we take $$G_1 = G_2 = G$$ and consider the group $$G \times G$$, this has a diagonal subgroup:

$$\{ (g,g) \mid g \in G \}$$

which is not of the indicated form.

However, the statement is true in some cases. For finite groups, it is true in the case that $$G_1$$ and $$G_2$$ have relatively prime orders to each other. (reference needed).