Solution (source code)

= Solution

Let $\pi:G\to G/K$ be the <quotient group> homomorphism. Its restriction to $X$ is injective because its kernel there is $K\cap X=\{1\}$. Since $g\in K$, $\pi(x_ig)=\pi(x_i)$ for every generator. Let $F_n$ be the abstract <free group> on letters $a_1,\ldots,a_n$ and define the surjective <group homomorphism> $\alpha:F_n\to\langle x_1g,\ldots,x_ng\rangle$ by $\alpha(a_i)=x_ig$. If $w\in\ker\alpha$, then
$$
1=\pi(\alpha(w))=w(\pi(x_1),\ldots,\pi(x_n)).
$$
Injectivity on $X$ implies $w(x_1,\ldots,x_n)=1$ in $X$. Those elements are a <free basis of a group>, so $w$ is the empty reduced word in $F_n$. Thus $\ker\alpha=\{1\}$. This is <freeness detected by a quotient>, and proves
$$
\boxed{\langle x_1g,\ldots,x_ng\rangle\cong F_n\quad\text{freely on the displayed generators}.}
$$