Let $G$ and $H$ be two finitely generated groups. If $\varphi_G:G\to\mathbb{Z}$ and $\varphi_H:H\to\mathbb{Z}$ are surjective homomorphisms prove that exists $\varphi:G\times H\to\mathbb{Z}$ with finitely generated kernel. I read this fact on a paper but without proof, so I thought that this must be either easy or well-known, however I failed.
The idea I had was that $G=\ker(\varphi_G)\rtimes\mathbb{Z}$ and $H=\ker(\varphi_H)\rtimes\mathbb{Z}$ so $K=(\ker(\varphi_G)\times\ker(\varphi_H))\rtimes \mathbb{Z}$ is finitely generated. So I was trying to find a map $\varphi$ with $K$ as its kernel, but I failed. The ideas of maps I thought were: $$\varphi(g,h)=\varphi_G(g)+\varphi_H(h),\varphi(g,h)=\varphi_G(g)-\varphi_H(h)$$ or $$\varphi(g,h)=\varphi_G(g)\varphi_H(h)$$ but none of them seemed to work and I don't know any other possibilty for $\varphi$.
Thanks for your help.
We have $G \cong K_1 \rtimes_\alpha \mathbb Z$ and $H \cong K_2 \rtimes_\beta \mathbb Z$, so $G \times H \cong (K_1 \times K_2) \rtimes_{\alpha \times \beta} (\mathbb Z \times \mathbb Z)$ . Let $\varphi(g, h) = \varphi_G(g) - \varphi_H(h)$ and let $K = \ker(\varphi)$. Then $$K = ((K_1 \times K_2) \rtimes (\mathbb Z \times \mathbb Z)) \cap K = (K_1 \times K_2) \rtimes ((\mathbb Z \times \mathbb Z) \cap K)$$ (this is the so-called "modular law of groups"). The group $(\mathbb Z \times \mathbb Z) \cap K$ is $\langle(1,1)\rangle \cong \mathbb Z$, so $$K \cong (K_1 \times K_2) \rtimes_{(\alpha,\beta)} \mathbb Z.$$ As you have presumably noted already, $K$ is generated by isomorphic copies of $G$ and $H$, so it is finitely generated.