The answer is no. Take $H$ any topological group, $H'$ another topological group having a noncentral element $a'$ of order 2, $G=H\times H'$, $a=1_H\times a'$ and $f=h\times inv_{H'}$ where $h$ is any anti-automorphism of $H$ and $inv_{h'}$ is the map $h'\mapsto h'^{-1},h'\in H'$.