Amalgamated product of groups This is just a problem solving question.
Let $G$ be a finitely generated group such that $G=A*_CB$ where $|A:C|=|B:C|=2$ and $A,B$ are finite. Show that $G$ has a finite index subgroup isomorphic to $\mathbb{Z}$.
(I tried to solve problems in my study note. But, for above one, I couldn't catch the start point. Anyone gives a small hint would be very helpful to me.)
 A: Inspiration: in the free product $H=C_2*C_2=\langle a,b|a^2,b^2\rangle$ the element $ab$ has infinite order. And furthermore the only nontrivial coset of $\langle ab\rangle$ is $b\langle ab\rangle$ (every word in $H$ is either a product of $ab$s or it is $b$ followed by a product of $ab$s), so $\langle ab\rangle$ has index two.
The given information in this problem tells us $A=C\sqcup aC$ and $B=C\sqcup bC$ with the additional tidbits that $aC=Ca$ and $bC=Cb$. We may conclude $G=A*_CB$ is generated $a,b,C$ in $G$.
Consider the element $ab$ in $G$. It has infinite order, so it generates a cyclic group - what is the resulting index? Split into two indices, $G:\langle ab,C\rangle:\langle ab\rangle$. Note that $A,B$ finite $\Rightarrow C$ finite.
To compute $[\langle a,b,C\rangle:\langle ab,C\rangle]$, "mod out $C$" and take $[\langle a,b\rangle:\langle ab\rangle]=2$ (back in our $H=C_2*C_2$) as inspiration, and to compute $[\langle ab,C\rangle:\langle ab\rangle]$, "mod out $ab$."
A: A fancy way to look at this is using Bass-Serre theory. Because the edge groups have index 2 in the vertex groups, in the resulting Bass-Serre tree every vertex will have two connected edges; in other words, the Bass-Serre tree corresponding to this amalgamated product  will be an infinite line (which is a very boring sort of tree).
It follows that $G$ acts discretely by isometries on the real line. What is the kernel of this action? What are the groups of discrete isometries of the real line?
