If $G_1, G_2, G_3$ are abelian groups and $0 \to G_1 \xrightarrow{\varphi_1} G_2 \xrightarrow{\varphi_2} G_3 \to 0$ is exact, then $G_2 \simeq \ker(\varphi_2) \oplus \text{im}(\varphi_2) \simeq G_1 \oplus G_3$
The above is the conclusion of Example 12.2 in Nonlinear Analysis and Semilinear Elliptic Problems, by Ambrosetti and Malchiodi.
I worked out as follows:
By exactness, ${0} = \ker(\varphi_1)$, so $G_1 \simeq \text{im}(\varphi_1) = \ker(\varphi_2) \lhd G_2$, so it makes sense to consider $G_2/G_1$. On the other hand, again by exactness, $\text{im}(\varphi_2) = G_3$. By the First Isomorphism Theorem, $$ G_2/ \ker(\varphi_2) \simeq G_2/G_1 \simeq G_3. $$
What one would like to do now is to "multiply both sides by $G_1$ and cancel out in the left-hand side". My question is, how to do it in a rigorous way?
I tried to write $G_2/G_1$ explicitly, but it was a dead end. I also tried to follow the hint by Najib Idrissi in this question, but failed.
Thanks in advace.