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.
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.
Best Answer
Your solution is not wrong but it has unnecassary steps. You can simply use following arguments.
Let $\pi:G\times H\to G$ be projection map .i.e. $\pi(g,h)=g$. It is clear that map is onto.
Claim$1:$ $\pi$ is an homomorphism;
$$\pi((g_1,h_1)(g_2,h_2))=\pi((g_1g_2,h_1h_2))=g_1g_2=\pi((g_1,h_1))\pi((g_2,h_2))$$ and since it is onto map it is an epimorphism.
Claim$2$: $Ker(\pi)=e_G\times H$
Let $\pi(x,y)=e_g$ then you can say that $x=e_g$ and $y$ is any element in $H$ so result follows. By the way it also show that $e_G\times H$ is normal in $G\times H$.
Result: By first isomorphim theorem; $$(G\times H)/ker(\pi)=(G\times H)/(e_G\times H)\cong G$$
Notes: By using the other projection you can show smiliar argument for $G\times e_H$ and $H$. I hope you are familiar with isomorphism theorems.