Solution (source code)

= Solution

Introduce $b=t^{-1}at$. The presentation may be written as the <HNN extension>
$$
G=\left\langle a,b,t\mathrel{\middle|}bab^{-1}=a^2, t^{-1}at=b\right\rangle
$$
of the <Baumslag-Solitar group> $\operatorname{BS}(1,2)=\langle a,b\mid bab^{-1}=a^2\rangle$, with stable letter $t$ identifying the infinite cyclic subgroups $\langle a\rangle$ and $\langle b\rangle$. <Britton's lemma> embeds the base group in the HNN extension. In particular, $a$ has <infinite order>, so $G$ is infinite. It is also nonabelian because $bab^{-1}=a^2\ne a$.