Solution (source code)

= Solution

An extension of $A$ by $B$ is a <short exact sequence> $1\to A\to G\to B\to1$. It splits if the quotient map has a homomorphic section. Equivalently the embedded $A$ has a subgroup complement isomorphic to $B$, and $G$ is the corresponding <semidirect product>.

For $t\notin K$ and $a\in K$, both $t$ and $ta$ lie outside $K$, so $t^2=(ta)^2=1$. It follows that $tat=a^{-1}$, and $t=t^{-1}$ gives the claimed <conjugation> identity. <Conjugation> is an <automorphism> of $K$, so inversion is an <automorphism> there. Comparing the image of $ab$ with the product of the images gives $b^{-1}a^{-1}=a^{-1}b^{-1}$. Therefore \b[$K$ is abelian].

Conversely inversion is an <automorphism> of any <abelian group> $A$, of order dividing two. Form the <semidirect product> $G=A\rtimes C_2$ with multiplication
$$
(a,\varepsilon)(b,\delta)=(ab^{(-1)^\varepsilon},\varepsilon+\delta),\qquad\varepsilon,\delta\in\mathbb Z/2.
$$
For completeness associativity follows because $b\mapsto b^{(-1)^\varepsilon}$ is an <automorphism> and these automorphisms compose according to addition modulo two; $(1,0)$ is the identity and inverses follow from this formula. The subgroup $H=A\times\{0\}$ is normal with quotient $C_2$, and every outside element satisfies $(a,1)^2=(aa^{-1},0)=1$. Thus \b[the <generalized dihedral group> supplies the required extension], including when $A$ is infinite or has elements of order two.