Nope. Take $H$ any topological group, $G=H\times\mathbb{Z}/2$, $a$ the generator of $\mathbb{Z}/2$ and $f=g\times id_{\mathbb{Z}/2}$ where $g$ is any endomorphism of $H$.