Definition. The cartesian product of two groups $G=G_1\times G_2$ is a group under the operation $(a,b)(c,d)=(ac,bd)$ together with these two maps:
$$
\begin{equation}
p_1\colon G\to G_1;~(x_1,x_2)p_1=x_1\\
p_2\colon G\to G_2;~(x_1,x_2)p_2=x_2
\end{equation}
$$
(Theorem. $p_1$ and $p_2$ are group homomorphisms, and $\forall x_1\in G_1,\forall x_2\in G_2,\exists|x\in G$ such that $xp_1=x_1$ and $xp_2=x_2$. Moreover let
$$
\begin{equation}
i_1\colon G_1\to G;~x_1i_1=(x_1,e_{G_2})\\
i_2\colon G_2\to G;~x_2i_2=(e_{G_1},x_2)
\end{equation}
$$
it results that
$$i_np_m=\begin{cases}I_{G_n}&\text{ if }n=m\\
O_{G_nG_m}&\text{ if }n\ne m
\end{cases}$$
where $n,m\in\{1,2\}$ and $O_{XY}\colon X\to Y;~x\mapsto e_Y$ with $Y$ group.
)
Definition. A direct product of two groups usually written again as $G_1\times G_2$ but that we will write as $A=(\{G_1, G_2\}, \{q_1,q_2\})$ is a group under the operation $(a,b)(c,d)=(ac,bd)$ together with these two homomorphisms:
$$
\begin{equation}
q_1\colon A\to G_1\\
q_2\colon A\to G_2
\end{equation}
$$
for which $\exists$ homomorphisms $j_k\colon G_k\to G$ where $k=1,2$ such that
$$j_nq_m=\begin{cases}I_{G_n}&\text{ if }n=m\\
O_{G_nG_m}&\text{ if }n\ne m
\end{cases}$$
where $n,m\in\{1,2\}$
Definition. A direct-product group isomorphism is a group isomorphism $T:A\to B$, where $A=(\{G_1,G_2\},\{q_1,q_2\})$ and $B=(\{G_1,G_2\},\{r_1,r_2\})$ direct products of two groups $G_1$ and $G_2$, such that
$$
\begin{equation}
r_m=Tq_m
\end{equation}
$$
where $m=1,2$
(Theorem. The cartesian product is a direct product, that is, $G_1\times G_2=(\{G_1, G_2\}, \{p_1, p_2\})$, where $p_1$ and $p_2$ have been defined in the first of our definitions above. Moreover any direct product $A$ of two groups $G_1$ and $G_2$ is direct-product group isomorphic to the cartesian product group $G_1\times G_2$)
All that said, what you name 'proof' is not the proof of the converse of the main theorem but a lemma, probably made difficult to read because the letter $G$ has been reused with a different meaning w.r.t. that used in the main theorem. So first let's rewrite it avoiding such problem:
Lemma. The cartesian product $G_1 \times G_2$ is such that $G_1 \times G_2 = H_1H_2 $ with $H_1 = G_1 \times \{e_{G_2}\}$ and $H_2 = \{e_{G_1}\} \times G_2$. The groups $H_1,H_2$ are normal in $G_1 \times G_2$ and $H_1 \cap H_2 = \{e\} \quad \triangle$
Now by the main theorem and this lemma it follows:
Corollary. The cartesian product of two groups $G_1\times G_2$ is isomorphic
to a direct product of $H_1$ and $H_2$ where $H_1 = G_1 \times \{e_{G_2}\}$ and $H_2 = \{e_{G_1}\} \times G_2$, and in particular $G_1\times G_2\cong H_1\times H_2$, that is $H_1\times H_2=(\{G_1,G_2\},\{q_1, q_2\})$ where
$$
\begin{equation}
q_1\colon H_1\times H_2\to G_1;~(x_1,0,0,x_2)\mapsto x_1\\
q_2\colon H_1\times H_2\to G_2;~(x_1,0,0,x_2)\mapsto x_2
\end{equation}
$$
and $\exists$ an isomorphism $T\colon H_1\times H_2\to G_1\times G_2$ such that $q_n=Tp_n$, where $n=1,2$, indeed $$T\colon (x_1,0,0,x_2)\mapsto(x_1,x_2)$$
Moreover:
- being $H_1\lhd G_1\times G_2$ it results that $G_1=H_1T^{-1} \lhd (G_1\times G_2)T^{-1}=H_1\times H_2$
- being $H_1H_2=G_1\times G_2$ it results that $G_1G_2=(H_1T^{-1})(H_2T^{-1})=(H_1H_2)T^{-1}=(G_1\times G_2)T^{-1}=H_1\times H_2$
- being $H_1\cap H_2=\{e\}$, it results that $G_1\cap G_2=H_1T^{-1}\cap H_2T^{-1}=(H_1\cap H_2)T^{-1}=\{e\}T^{-1}=\{e\}$
Proof of the converse of the main theorem. Let $G$ be a direct product of two subgroups of its, $G=(\{G_1, G_2\}, \{r_1, r_2\})$. Then $G$ is direct-product group isomorphic to the cartesian product of those subgroups $G\cong G_1\times G_2$. But then by the corollary it is also $G\cong H_1\times H_2$. That means that $\exists U\colon G\to H_1\times H_2$ direct-product group isomorphism such that $r_n=Uq_n$, where $n=1,2$. For the corollary $H_1\times H_2$ has two subgroups that satisfy the conditions of the main theorem, but then thanks to $U$, $G$ have two subgroups satisfying those conditions as well.
To spill the beans: this happens if and only if both $G_1$ and $G_2$ are torsion groups, and for every $x\in G_1$ and $y\in G_2$, $\gcd(|x|,|y|)=1$.
Once you figure out the statement one can prove it directly, as I do below; but I arrived at it using my favorite "hammer" to deal with subgroups of $G_1\times G_2$, Goursat's Lemma. So I leave the development that led to the result below.
The subgroups of $G_1\times G_2$ are described by Goursat's Lemma. Each such subgroup corresponds to a $5$-tuple $(H_1,N_1,H_2,N_2,\varphi)$, where
- $H_i$ is a subgroup of $G_i$, $i=1,2$.
- $N_i\triangleleft H_i$, $i=1,2$.
- $\varphi$ is an isomorphism $\varphi\colon \frac{H_1}{N_1}\to \frac{H_2}{N_2}$.
Such a tuple corresponds to the subgroup
$$\{ (x,y)\in G_1\times G_2\mid x\in H_1, y\in H_2, \varphi(xN_1)=yN_2\}.$$
So the question is: when will such a subgroup be equal to $H_1\times H_2$? That will happen if and only if $\varphi(xN_1)=yN_2$ for every $x\in H_1$ and every $y\in H_2$. This in turn means that $N_1=H_1$ and $N_2=H_2$.
If $G$ is a group, Let us denote by $\mathbf{HS}(G)$ the class of all groups that are isomorphic to a homomorphic image of a subgroup of $G$ (that is, isomorphic to $H/N$ for some $H\leq G$ and $N\triangleleft H$).
Thus, we have:
Theorem. Let $G_1$ and $G_2$ be two groups. The following are equivalent:
- Every subgroup of $G_1\times G_2$ is equal to $H_1\times H_2$ for some $H_1\leq G_1$ and $H_2\leq G_2$.
- The only group that the classes $\mathbf{HS}(G_1)$ and $\mathbf{HS}(G_2)$ have in common is the trivial group.
For finite groups, the condition is very strong:
Corollary 1. Let $G_1$ and $G_2$ be two finite groups. The following are equivalent:
- Every subgroup of $G_1\times G_2$ is equal to $H_1\times H_2$ for some $H_1\leq G_1$ and $H_2\leq G_2$.
- $\gcd(|G_1|,|G_2|)=1$.
Proof. Since the order of an element of $\mathbf{HS}(G)$ divides the order of $G$ when $G$ is finite, condition 2 implies condition 2 of the theorem. If $|G_1|$ and $|G_2|$ are not relatively prime, let $p$ be a prime dividing both, and let $x\in G_1$, $y\in G_2$ be elements of order $p$. The subgroup $\langle (x,y)\rangle$ is cyclic of order $p$ with both projections nontrivial, and so it is not of the form described in 1. $\Box$
Corollary 2. Let $G_1$ and $G_2$ be nontrivial groups, and assume that $G_1$ is infinite.
- If $G_1$ is not torsion, then there are subgroups of $G_1\times G_2$ that are not of the form $H_1\times H_2$ with $H_i\leq G_i$.
- If both $G_1$ and $G_2$ are torsion, then every subgroup of $G_1\times G_2$ is of the form $H_1\times H_2$ with $H_i\leq G_i$ if and only if there is no prime $p$ such that both $G_1$ and $G_2$ have elements of order $p$. Equivalently, if $x\in G_1$ and $y\in G_2$, then $\gcd(|x|,|y|)=1$.
Proof. 1. Let $x\in G_1$ be of infinite order. Let $y\in G_2$ be an arbitrary nontrivial element. Then there is a quotient of $\langle x\rangle$ isomorphic $\langle y\rangle$, and the conclusion follows from the theorem.
- If $G_1$ and $G_2$ have elements of order $p$, then the result follows as in Corollary 1. Otherwise, let $H_i\leq G_i$ and $N_i\triangleleft H_i$ with $H_1/N_1$ isomorphic to $H_2/N_2$. Every element of $H_1/N_1$ has order dividing the order of an element of $G_1$; every element of $H_2/N_2$ has order dividing the order of an element of $G_2$. But the orders of elements of $G_1$ and of $G_2$ are coprime, so both $H_1/N_1$ and $H_2/N_2$ are trivial. $\Box$
In summary the promised result:
Theorem. Let $G_1$ and $G_2$ be groups. Then every subgroup of $G_1\times G_2$ is of the form $H_1\times H_2$ with $H_i\leq G_i$ if and only if both $G_1$ and $G_2$ are torsion groups, and for every $x\in G_1$ and $y\in G_2$, $\gcd(|x|,|y|)=1$.
This follows directly from the development done above, but here is a direct, constructive, elementary proof that does not invoke Goursat's Lemma.
Proof. For the "if" directly, if $S$ is a subgroup of $G_1\times G_2$ and $(x,y)\in S$, then since $\gcd(|x|,|y|)=1$ there exist $a$ and $b$ such that $a\equiv 0\pmod{|x|}$, $a\equiv 1\pmod{|y|}$, and $b\equiv 1\pmod{|x|}$, $b\equiv 0\pmod{|y|}$. Then $(x,y)^a = (e,y)$ and $(x,y)^b=(x,e)$, so both $(x,e)$ and $(e,y)$ are in $S$. Thus, $S=\pi_1(S)\times\pi_2(S)$.
For the "only if" clause, let $x\in G_1$ and $y\in G_2$; we must prove they are both torsion elements and their orders are relatively prime. Without loss of generality assume that $x\neq e$ (if both are trivial, they desired conclusion follows). Consider the group $H=\langle (x,y)\rangle$. Because $H=H_1\times H_2$ for some subgroups $H_1\leq G_1$ and $H_2\leq G_2$, we must have $(x,e)\in H$. So there exists an integer $k$ such that $(x,y)^k = (x^k,y^k)=(x,e)$. In particular, $y$ is of finite order that divides $k$; and $x$ is also of finite order and $k$ is congruent to $1$ modulo the order of $x$. That means that the order of $x$ is relatively prime to $k$, and hence to its divisor the order of $y$; so $x$ and $y$ are torsion elements and $\gcd(|x|,|y|)=1$, as claimed. $\Box$
Best Answer
Let $(g_1, g_2), (h_1, h_2)\in H_1\times H_2$. We show that $(g_1, g_2)(h_1, h_2)^{-1}\in H_1\times H_2$ to fulfill the requirements of the one-step subgroup test (as you have already shown that $H_1\times H_2$ is nonempty).
Indeed, we have
$$\begin{align} (g_1, g_2)(h_1, h_2)^{-1}&=(g_1, g_2)(h_1^{-1}, h_2^{-1})\\ &=(g_1\ast h_1^{-1}, g_2!h_2^{-1})\\ &\in H_1\times H_2, \end{align}$$
since $H_1\le G_1$ and $H_2\le G_2$.