Your method is not correct. It proves(?) for example that necessarily $\operatorname{Ker}F= \{0\}$.
Here is a proof:
Note that the only finite subgroups of $\mathbb{Q}^*$ are $\{1\},\{1,-1\}$. Also the only subgroups of $\mathbb{Z}$ are $n \mathbb{Z}, \mathbb{Z}$ and $\frac{\mathbb{Z}}{n \mathbb{Z}} $ has $n$ elements. (Why ?)
Now as you correctly said whatever $F$ is, it induce a group isomorphism $T:\frac{\mathbb{Z}}{\operatorname{Ker} F} \to \operatorname{Im}F$.
Since $\operatorname{Im}F$ is a subgroup of $\mathbb{Q}^*$, if $\operatorname{Im}F$ is finite we only have two possibilities for $\operatorname{Im}F$. But $F$ is non trivial so $\operatorname{Im}F \neq \{1\}$. So we left with only one possibility $\operatorname{Im}F = \{1,-1\}$. Therefore $\operatorname{Card}(\frac{\mathbb{Z}}{\operatorname{Ker} F})=2$.
Now if $\operatorname{Im}F$ is infinite $\operatorname{Card}(\frac{\mathbb{Z}}{\operatorname{Ker} F})= \infty$.
This mean $\operatorname{Ker}F= 2 \mathbb{Z}$ or $\operatorname{ker}F = \mathbb{Z}$.
Let me just replicate YCor's comment in the link that was given in the comments, with more details :
in a free product $C\ast D$ with $C,D$ nontrivial, the intersection of any two nontrivial normal subgroups is nontrivial.
Indeed, let $H,K$ be two nontrivial normal subgroups of $C*D$. I'll assume for simplicity that $|C|,|D|$ are large enough so that for each $x,y$ there is a nontrivial $z$ with $z^{-1}\neq x, z\neq y$. For instance $|C|, |D|\geq 4$ is good enough (take $x,y$, then there are at most two nontrivial $z$ such that $z=x$ or $z^{-1}=y$ : $x$ and $y^{-1}$; so if $|G|\geq 4$, any nontrivial element different from $x$ and $y^{-1}$ works)
Let me say that $c_1d_1\dots c_nd_n$ is the reduced form of an element of $C*D$ if $c_i\in C, d_j\in D$, and the only $c_i,d_j$ allowed to be $1$ are $c_1$ and $d_n$. Clearly, if $x=c_1d_1\dots c_nd_n$ is the reduced form of $x$, and $n\geq 2$, then $x\neq 1$ in $C*D$ ("clearly" here is to be understood as : it's a classical property of free products), moreover, if $n=1$ this is $1$ if and only if $c_1=d_1=1$.
Now let $x= c_1d_1\dots c_rd_r \in H, y=c'_1d'_1\dots c'_sd'_s \in K$ be nontrivial elements, with obvious notations, written in reduced form. The point will be that $[x,y]\in H\cap K$ (this is obvious by normality), and that, up to changing $x,y$ a bit, this can't be the trivial element.
Now up to conjugation by some element of $C$, one may assume $d_r = 1$ and $c_1\neq 1$ (this can be done by the hypothesis on $|C|$ - and $c_r \neq 1$, but that follows from the reduced form); and up to conjugation by some element of $D$, $c'_1 = 1$ , $d_s'\neq 1$ (using the cardinality hypothesis on $D$ - and $d_1' \neq 1$, but again this follows from the reduced form).
So with these hypotheses $$[x,y] = \color{red}{c_1d_1\dots c_r}\color{blue}{d_1'\dots c_s'd_s'}\color{red}{c_r^{-1}\dots d_1^{-1}c_1^{-1}}\color{blue}{d_s'^{-1}c_s'^{-1}\dots d_1'^{-1}},$$ which is written in reduced form, and is thus $\neq 1$. Therefore $[x,y]\in H\cap K\setminus\{1\}$.
Apply this to your supposed $A\times \{1\}, \{1\}\times B$ to get a contradiction.
I don't know if there's an easier argument, or a not-too-complicated argument that encapsulates the low cardinality cases, but I guess for these you have to go "by hand" somehow; or perhaps you can adapt this argument to these cases by working a bit more. In any case I didn't want to bother with these cases, and this argument works in most cases and is pretty painless so in any case it's interesting to share
Best Answer
Suppose $\phi: \mathbb{R} \to \mathbb{Z}$ is a group homomorphism, and let $x \in \mathbb{R}$, and let $n = \phi(x)$. Then \begin{align*} n &= \phi(x) \\ &= \phi\left((n+1)\left(\frac{x}{n+1}\right)\right) \\ &= (n+1) \phi\left( \frac{x}{n+1} \right). \end{align*} Therefore, $\phi\left( \frac{x}{n+1} \right) = \frac{n}{n+1}$. But this has to be an integer, so we conclude that $\boldsymbol{n=0}$. (The argument was technically incorrect for $n=-1$. We could use $n^2 + 1$ instead of $n+1$.)
In other words, $\phi(x) = 0$ for all $x \in \mathbb{R}$, since $x$ was arbitrary.