It seems probably "yes", but the case $4|n$ is a pain. The following method covers all cases except when all of the following conditions hold: $4|n$, $a = -h^2$, and $b = -g^2$ for nonzero rational $h$ and $g$.

First, to save notation later, we note that it is harmless to initially replace $a$ with $a^i$ for any $i$ coprime to $n$, and likewise to replace $b$ with $b^j$ for any $j$ coprime to $n$. Such appropriate $i$ and $j$ can be found via Kummer theory over $\mathbf{Q}(\zeta_n)$; let's give that predictable argument now. By hypothesis the polynomials $X^n - a$ and $X^n - b$ over $\mathbf{Q}$ admit respective roots $\alpha$ and $\beta$ in an algebraic closure (or equivalently, in a sufficiently large finite Galois extension) $F$ of $\mathbf{Q}$ such that $\mathbf{Q}(\alpha) = \mathbf{Q}(\beta)$ as subfields of $F$. Consider the subfield $K = \mathbf{Q}(\zeta_n)$ of $F$ which contains a primitive $n$th root of unity. Then $K(\alpha) = K(\beta)$ inside $F$, yet $K(\alpha)$ is visibly a splitting field over $K$ of the (possibly reducible) polynomial $X^n-a \in K[X]$ and likewise $K(\beta)$ is visibly a splitting field over $K$ of $X^n - b \in K[X]$. Hence, by usual Kummer theory there exist $i, j$ coprime to $n$ such that $a^i/b^j$ is an $n$th power in $K$. Now taking advantage of our initial remark about adjustment of $a$ and $b$, we may and do assume that $a/b$ becomes an $n$th power in $\mathbf{Q}(\zeta_n)$.

It therefore is sufficient (though not necessary!) to prove for $n \ge 1$ that if a nonzero $q \in \mathbf{Q}$ becomes an $n$th power in $\mathbf{Q}(\zeta_n)$ then $q$ is an $n$th power in $\mathbf{Q}$.

This sufficient criterion fails for $n=2m$ with odd $m$, as we see via $m$th powers of non-squares whose square roots generate quadratic subfields of $\mathbf{Q}(\zeta_{n})$ for such $n$. We will prove this sufficient criterion for odd $n$, and then use that conclusion (and even method of proof) to address even $n$.

**Case $n$ odd**

Here are two methods. Firstly, this case can be handled by the method in Pace Nielsen's answer without sign constraints since (i) for odd primes $p$ the group $\mathbf{R}^{\times}$ is $p$-divisible, (ii) for $n$ odd (or twice an odd) and any nonzero rational $t$ the polynomial $X^n - t$ is irreducible over $\mathbf{Q}$ if and only if $t$ is not a rational $p$th-power for every prime $p|n$ (due to Theorem 9.1 in Chapter VI of the 3rd edition of Lang's "Algebra", which entails an extra constraint when $4|n$).

The following second method has the merit that it never uses the irreducibility hypothesis on $X^n-a$ and $X^n-b$ over $\mathbf{Q}$ (but we will need such irreducibility all over the place when handling even $n$, as we must since
a root of the reducible $X^4+4 = (X^2 +2x+2)(X^2-2X+2)$ generates the field $\mathbf{Q}(i)$ that is generated by a root of the reducible $(X^2+1)(X^2-1) = X^4-1$).

I claim for any $n$ (allowing even $n$ too -- useful for later!) and *odd* positive $d|n$ that the natural map $\mathbf{Q}^{\times}/{\mathbf{Q}^{\times}}^d \rightarrow \mathbf{Q}(\zeta_n)^{\times}/{\mathbf{Q}(\zeta_n)^{\times}}^d$ is injective. Passing to $p$-primary parts for primes $p|d$, we may assume $d=p^j$ for $1 \le j \le e = {\rm{ord}}_p(n)$ with $p$ an odd prime. Since $\mathbf{Q}^{\times}$ has no nontrivial $p$th root of unity (as $p$ is odd), the right-exact sequence
$$\mathbf{Q}^{\times}/{\mathbf{Q}^{\times}}^p \stackrel{x^{p^{j-1}}}{\rightarrow}
\mathbf{Q}^{\times}/{\mathbf{Q}^{\times}}^{p^j} \rightarrow
\mathbf{Q}^{\times}/{\mathbf{Q}^{\times}}^{p^{j-1}} \rightarrow 1$$
is also injective on the left and hence is short exact. (The informed reader will recognize this as expressing a fact about Galois cohomology formalism, but that is not logically necessary, though it certainly informs the motivation for what I am about to do.) Likewise, since
the group of $p^{j-1}$th-roots of unity in $\mathbf{Q}(\zeta_n)$ is the image under $p$-power on the group of $p^j$th-roots of unity in $\mathbf{Q}(\zeta_n)$ (here we use that $p^j|n$ rather than that $p$ is odd), it follows by reasoning with the snake lemma or elementary Galois cohomology formalism that the analogous right-exact sequence for $\mathbf{Q}(\zeta_n)$ in place of $\mathbf{Q}$ is *also* injective on the left and hence is short exact. The two resulting *short exact* sequences fit into an evident commutative diagram, so by induction on $j$ the injectivity assertion is reduced to the case $j=1$.

Now it remains to show that if $q$ is a nonzero rational and $q = \theta^p$ for some $\theta \in \mathbf{Q}(\zeta_n)$ then $q$ is the $p$th-power of a rational number. If $q$ is not such a $p$th-power then $X^p - q$ is irreducible over $\mathbf{Q}$ and so the root $\theta$ generates a degree-$p$ extension of $\mathbf{Q}$ which must be *abelian* (and in particular Galois). Hence, this primitive extension has to split $X^p-q$, so it must contain a primitive $p$th root of unity. Being a degree-$p$ extension, it follows that the degree $p-1$ of $\mathbf{Q}(\zeta_p)$ over $\mathbf{Q}$ must divide $p$. That forces $p=2$, a contradiction.

This settles the case of odd $n$, and also shows
for general $n$ that $b/a = c^{n'}$ for some rational $c$ with $n'$ the "odd part" of $n$ (and again we have not yet used
irreducibility of $X^n-a$ and $X^n-b$ over $\mathbf{Q}$).

**Case $n$ even**

Now we may assume $n = 2^en'$ for odd $n'$ and $e \ge 1$. As we saw above, $b/a = c^{n'}$ for a nonzero rational $c$. To go further, we need a property of the field $\mathbf{Q}(\alpha)$ (which we will prove when $e=1$, and when $e > 1$ provided
that $a$ and $b$ are not negatives of rational squares):

**P**: there is a unique quadratic subfield (so $\mathbf{Q}(\sqrt{a})$ is the unique one).

Here is an important consequence of P when $4|n$: for $m|n$ that is a power of 2, if $\mathbf{Q}(\zeta_m) \subset \mathbf{Q}(\alpha)$ then $m|4$. Indeed, otherwise $8|m$ yet $\mathbf{Q}(\zeta_8)$ does not have a unique quadratic subfield.

Via Galois theory, P reduces to a group theory problem for subgroups $G$ of $\mathbf{Z}/n\mathbf{Z} \rtimes (\mathbf{Z}/n\mathbf{Z})^{\times}$ such that $p_2:G \rightarrow (\mathbf{Z}/n\mathbf{Z})^{\times}$ is surjective and $H := G \cap (\mathbf{Z}/n\mathbf{Z})^{\times}$ has index $n$ in $G$. Namely, is the only index-2 subgroup of $G$ containing $H$ precisely $G \cap (((n/2)\mathbf{Z}/n\mathbf{Z}) \rtimes (\mathbf{Z}/n\mathbf{Z})^{\times})$? If $e=1$ then the answer is affirmative. Indeed, in such cases $n=2n'$ with $n'$ odd, so $(\mathbf{Z}/n\mathbf{Z})^{\times} = (\mathbf{Z}/n'\mathbf{Z})^{\times}$ and $\mathbf{Z}/n\mathbf{Z} = \mathbf{Z}/2\mathbf{Z} \times \mathbf{Z}/n'\mathbf{Z}$ with $\mathbf{Z}/2\mathbf{Z}$ the 2-part. Thus, $G$ is a subgroup of
$$\mathbf{Z}/2\mathbf{Z} \times (\mathbf{Z}/n'\mathbf{Z} \rtimes (\mathbf{Z}/n'\mathbf{Z})^{\times}),$$
so the image $G'$ of $G$ in $\mathbf{Z}/n'\mathbf{Z} \rtimes (\mathbf{Z}/n'\mathbf{Z})^{\times}$ (corresponding to the irreducible $X^{n'}-a$)
must be full (by applying Theorem 9.4 in Chapter VI of 3rd edition of Lang's
"Algebra" to the *odd* $n'$). So either $G$ is full or of index 2. Hence, $G$ contains the odd-order subgroup $\mathbf{Z}/n'\mathbf{Z}$. Passing to the quotient by this brings us to an analogous question for the commutative group $\mathbf{Z}/2\mathbf{Z} \times (\mathbf{Z}/n'\mathbf{Z})^{\times}$ that is easy.

Suppose $c$ is not a rational square, so
$\mathbf{Q}(\sqrt{c})$ is a quadratic subfield of $\mathbf{Q}(\alpha)$, but the only such field is $\mathbf{Q}(\sqrt{a})$ by P (which is proved when $e=1$), so $ac$ is a rational square. The same then holds for $ac^{n'}$ since $n'$ is odd, but $ac^{n'} = b$, contradicting that $X^n - b$ is irreducible over $\mathbf{Q}$ with $2|n$. Hence, $c$ must be a rational square, so $b/a$ is a $2n'$th-power of a rational number. This settles the case $e = 1$ unconditionally, so now assume $e \ge 2$.

This brings us to:

**Additional tedium to handle $4|n$**

We shall give a general argument when $4|n$ assuming P holds for the case under consideration. (This cannot happen
if $a = -h^2$ for rational positive $h$, as then $\mathbf{Q}(\alpha^{n/4})$ is
the biquadratic $\mathbf{Q}(i, \sqrt{h})$ when $h$ is a nonsquare and is $\mathbf{Q}(\zeta_8)$ when $h$ is a square.)
Then we will prove that P does hold when $4|n$ away from the case when $a$ is the negative of a rational square
(and so likewise away from the case when $b$ is the negative of a rational square); that will then
leave unsettled only the exceptional cases mentioned at the start, for which P definitely is false. I will leave it to someone else
to find an argument to handle such "biquadratic" situations.

Fix the choice of $\alpha$ in $\mathbf{C}$. The possibilities for $\beta$ in $\mathbf{C}$ take the form $\zeta \alpha c^{1/2^e}$ for an $n'$-th root of unity $\zeta$ and a $2^e$-th root of $c^{1/2^e}$ of $c$ in $\mathbf{C}$. Some such $\beta$ lies in $\mathbf{Q}(\alpha)$ by hypothesis, so this latter field must then contain $\beta/\alpha = \zeta c^{1/2^e}$. Hence, its $2^e$th-power $\zeta^{2^e} c$ lies in $\mathbf{Q}(\alpha)$, so $\zeta^{2^e}$ does since $c \in \mathbf{Q}^{\times}$. But $\zeta$ is a power of $\zeta^{2^e}$ since $\zeta$ is an odd-order root of unity, so $\zeta, c^{1/2^e} \in \mathbf{Q}(\alpha)$ too.
We can then replace $\beta$ with $\beta/\zeta$, so now $\beta = c^{1/2^e}\alpha$ for a $2^e$-th root $c^{1/2^e}$ of $c$ that lies in $\mathbf{Q}(\alpha)$.

Write $c = {c'}^{2^{e'}}$ for maximal $e' \le e$ and rational $c'$, so $1 \le e' \le e$. If $e' = e$ then we are done (as then $c^{n'} = {c'}^n$ is an $n$th power), so we assume $e' < e$. By maximality of $e'$, neither $c'$ nor $-c'$ is a rational square. Fix a $2^{e-e'}$th-root ${c'}^{1/2^{e-e'}}$ of $c'$, so the above distinguished $2^e$th root $c^{1/2^e} = \beta/\alpha$ has the form $z {c'}^{1/2^{e-e'}}$ for some $2^e$th-root of unity $z$. Raising the identity $\beta = z {c'}^{1/2^{e-e'}}\alpha$ to the $2^{e-e'}$th-power, we get $\beta^{2^{e-e'}} = \varepsilon c' \alpha^{2^{e-e'}}$ for $\varepsilon := z^{2^{e-e'}}$ a $2^{e'}$th-root of unity. But $\beta^{2^{e-e'}} \in \mathbf{Q}(\alpha)$, so the rational multiple $\varepsilon c'$ of $\varepsilon$ lies in $\mathbf{Q}(\alpha)$. Hence,
$\varepsilon \in \mathbf{Q}(\alpha)$.

By a consequence of P noted earlier, the $2^{e'}$th-root of unity $\varepsilon$ is equal to $\pm 1$ or $\pm i$.
In the $\pm i$ case, the unique quadratic subfield $\mathbf{Q}(\sqrt{a})$ (see P) would have to equal $\mathbf{Q}(i)$, forcing $a$ to be the negative of a rational square.
Let us rule out the possibility $a = -h^2$ for rational $h$. In such cases the 4th roots of $a$ lies in the field $\mathbf{Q}(\zeta_8, \sqrt{h})$ whose Galois group over $\mathbf{Q}$ is a direct product of 2 or 3 copies of $\mathbf{Z}/2\mathbf{Z}$. But that is inconsistent with the fact that the 4th root $\alpha^{n/4}$ of $a$ generates a quartic field with a *unique* quadratic subfield (by P).

We conclude that $\varepsilon = \pm 1$. In particular, $\varepsilon c'$ is not a rational square. Since $e-e' > 0$ we see that the non-square $\varepsilon c'$ becomes a square in $\mathbf{Q}(\alpha)$, so $\mathbf{Q}(\sqrt{\varepsilon c'}) = \mathbf{Q}(\sqrt{a})$. In such cases $\varepsilon c' = a u^2$ for rational $u$. Write $\varepsilon c' = a^s w^{2^f}$ with odd $s$, rational $w$ and *maximal* $1 \le f \le e-e'$ (so $\pm w$ are not rational squares); equivalently, $\beta^{2^{e-e'}} = a^s w^{2^f} \alpha^{2^{e-e'}}$ with odd $s$, rational $w$, and maximal $1 \le f \le e-e'$. (Here and in some places below the exponent of $2^f$ looks like $2f$; not sure why.)

If $f = e-e'$ then raising both sides to the $2^{e'}n'$th-power gives $b = a^{2^{e'}n's}w^n a$, so $b/a^{1+2^{e'}n's}$ is an $n$th power with $1+2^{e'}n's$ coprime to $n$ (since $e' > 0$).

Assume instead $f < e-e'$. We will deduce a contradiction in such cases. Since $a = \alpha^n$ is a $2^{e-e'}$th-power in $\mathbf{Q}(\alpha)$, we conclude that $w^{2^f}$ is too. Writing $w^{2^f} = x^{2^{e-e'}}$ for some $x \in \mathbf{Q}(\alpha)$, the ratio $x^{2^{e-e'-f}}/w$ in $\mathbf{Q}(\alpha)^{\times}$ is a $2^f$th root of unity. We saw that such a root of unity has to be $\pm 1$ or $\pm i$, so raising to the 4th power yields $x^{2^{e-e'-f+2}} = w^4$ with $e-e'-f+2 \ge 3$. Thus, $x^{2^{e-e'-f+1}} = \pm w^2$ with $e-e'-f+1 \ge 2$. In the case of $-w^2$ it follows that $-1$ is a square in $\mathbf{Q}(\alpha)$, so the unique quadratic subfield $\mathbf{Q}(\sqrt{a})$ (see P) coincides with $\mathbf{Q}(i)$, which is to say $-a$ is a rational square, a case that we have ruled out. Hence, $x^{2^{e-e'-f+1}} = w^2$, so $x^{2^{e-e'-f}} = \pm w$ with $e-e'+f \ge 1$. Thus, one of $\pm w$ becomes a square in $\mathbf{Q}(\alpha)$, but we saw that neither is a rational square, so one of $\pm w/a$ is a rational square: $w = \pm a {w'}^2$ for some sign and some rational $w'$. It follows that $w^{2^f} = a^{2^f}{w'}^{2^{f+1}}$, so $\beta^{2^{e-e'}} = a^{s+2^f} {w'}^{2^{f+1}} \alpha^{2^{e-e'}}$. Since $s+2^f$ is odd and $w'$ is rational, this contradicts the maximality of $f$.

**Verifying P when $4|n$ and $a$ is not negative of a rational square:**

Since $4|n$ and $X^n-a$ is irreducible, so is $X^4-a$. It is classical that the Galois group for the irreducible $X^4-a$ is
either $D_4 = (\mathbf{Z}/4\mathbf{Z}) \rtimes (\mathbf{Z}/4\mathbf{Z})^{\times}$ or $(\mathbf{Z}/2\mathbf{Z})^2$, with
the latter happening precisely when $a = -h^2$ for rational $h$ (in which case a single root generates the biquadratic
splitting field that is
$\mathbf{Q}(i, \sqrt{h})$ when $h$ is a non-square and $\mathbf{Q}(\zeta_8)$ when $h$ is a square).
Looking at the subgroup structure of $D_4$ and what corresponds to $\mathbf{Q}(\alpha)$ in cases with $n=4$,
another intrinsic characterization is that for $n=4$ the $D_4$-case is precisely the one for which $\mathbf{Q}(\alpha)$ admits
a unique quadratic subfield.

Consider a general rational
$c$ such that $X^n - c$ is irreducible (with $4|n$), and let $\mathbf{Q}(\gamma)$ be the field
generated by a root of $X^n - c$.
The Galois group $G$ for the splitting field of $\mathbf{Q}(\gamma)$ over $\mathbf{Q}$ is a subgroup of
$$G(n) := (\mathbf{Z}/n\mathbf{Z}) \rtimes (\mathbf{Z}/n\mathbf{Z})^{\times}$$
(see the discussion just above Theorem 9.4 in Ch. VI of the 3rd edition of Lang's "Algebra"),
where this injection $G \hookrightarrow G(n)$ is well-defined up to conjugation (given $c$).
The composite map $G \hookrightarrow G(n) \rightarrow G(8) = D_4$ has image that corresponds
exactly to the Galois group of the splitting field of $X^4-c$, so this map is surjective if and only if
$X^4-c$ has Galois group $D_4$. We claim that in such $D_4$-cases,
$\mathbf{Q}(\gamma)$ has a unique quadratic subfield.

Once this is proved, it follows that if $X^4 - a$ is in the $D_4$-case (i.e., $a$ is not the negative of a rational square)
then $\mathbf{Q}(\alpha)$ has a unique quadratic subfield, so likewise for $\mathbf{Q}(\beta) \simeq \mathbf{Q}(\alpha)$,
and hence the subfield $\mathbf{Q}(\beta^{n/4})$ has only one quadratic subfield. But then
$X^4 - b$ must also be in the "$D_4$-case" too (as otherwise $\mathbf{Q}(\beta^{n/4})$ would
be a biquadratic field). In other words, once the above general claim is proved
we would have unconditionally settled all cases except
those for which $4|n$ and $a = -h^2$ and $b = -g^2$ for nonzero rational $h$ and $g$.

The subfield $\mathbf{Q}(\gamma)$ corresponds to $G \cap (\{0\} \times (\mathbf{Z}/n\mathbf{Z})^{\times})$,
so our aim is to prove that this lies inside a unique index-2 subgroup of $G$ (as is clear when $G=G(n)$).
The hypothesis of being in the $D_4$-case says exactly that the reduction map $G \rightarrow G(4)$
is surjective, so $n=4$ is settled and we now assume $n > 4$.
Either $n = 2^e$ with $e \ge 3$ or $n = mp$ for an odd prime $p$ with $4|m$.

Consider the latter
cases, so $X^m - c$ fall into
the $D_4$-case (i.e., $X^4 - c$ has $D_4$ splitting field). Let $\gamma' = \gamma^p$, a root
of $X^m - c$, so by induction $\mathbf{Q}(\gamma')$ has a unique quadratic subfield.
Since $[\mathbf{Q}(\gamma):\mathbf{Q}] = n = mp = p[\mathbf{Q}(\gamma'):\mathbf{Q}]$,
$\mathbf{Q}(\gamma)$ is a degree-$p$ extension of $\mathbf{Q}(\gamma')$.
But $p$ is an odd prime, so if $F$ is a quadratic subfield of $\mathbf{Q}(\gamma)$ then it must lie
inside $\mathbf{Q}(\gamma')$ and so is unique by induction.

It remains to treat the case $n = 2^e$ with $e \ge 3$. First consider $e=3$. Then $G$ is a subgroup of $G(8)$ that
maps onto $G(4)$ (so its index divides $[G(8):G(4)] = 4$) and onto $(\mathbf{Z}/8\mathbf{Z})^{\times}$. By inspection, the element
$(2,1) \in G(4)$ of order 2 does not admit an order-2 lift in $G(8)$, so $G \twoheadrightarrow G(4)$
has nontrivial kernel. Thus, $G$ has index 1 or 2 in $G(8)$. If index 1 then we are done
for $e=3$, so assume the index is 2. Thus, $G$ contains $2\mathbf{Z}/8\mathbf{Z}$.
Since $G$ maps onto $G(4)=D_4$ and onto
$(\mathbf{Z}/8\mathbf{Z})^{\times}$, it is not hard to deduce that $G$ is the preimage of the graph inside
$\mathbf{Z}/2\mathbf{Z} \times (\mathbf{Z}/8\mathbf{Z})^{\times}$
of one of the two order-2 quotient $q: (\mathbf{Z}/8\mathbf{Z})^{\times} \twoheadrightarrow \mathbf{Z}/2\mathbf{Z}$
which is not the reduction onto $(\mathbf{Z}/4\mathbf{Z})^{\times}$.
In both cases, by inspection $G$ has a unique index-2 subgroup containing $G \cap (\mathbf{Z}/8\mathbf{Z})^{\times}$.
This settles $e = 3$.

Suppose $e \ge 4$. We proceed separately depending on whether the image of $G \rightarrow G(8)$
is full or one of the two index-2 subgroups obtained in the study of the case $e=3$ (applied to $X^8-c$).
First assume $G \rightarrow G(8)$ is surjective. In such cases we claim that $G = G(2^e)$ (so in such cases
there would be a unique quadratic subfield).
Proceeding by induction on $e\ge 4$, we can assume $G \rightarrow G(2^{e-1})$ is surjective (as holds when $e=4$ by hypothesis).
But $\#G(2^{e-1}) = (1/4)\#G(2^e)$, so $G$ has index 1, 2, or 4 in $G(2^e)$. If the index is 4 then $G$ maps isomorphically onto
$G(2^{e-1})$, so all elements of $G(2^{e-1})$ of order 2 would admit an order-2 lift in $G(2^e)$.
But inspection shows that none of the elements of $G(2^e)$ of order 2
reduce to the element $(2^{e-2},1) \in G(2^{e-1})$ of order 2. Hence, the index of $G$ in $G(2^e)$ is 1 or 2. Thus,
$G \cap ((\mathbf{Z}/2^e\mathbf{Z}) \times \{1\})$ has index 1 or 2 in $\mathbf{Z}/2^e \mathbf{Z}$.
If the latter index is 1 then $G$ contains the entire {\em normal} subgroup $\mathbf{Z}/2^e\mathbf{Z}$
of $G(2^e)$ yet maps onto the quotient by it, so
we would get $G=G(2^e)$ as desired.

Suppose instead that $G$ has index 2 in $G(2^e)$; we will show that $G$ cannot then map
onto $G(8)$ (and we will identify two possibilities for its image in $G(8)$). Certainly $G$
corresponds to an index-2 subgroup $H$ of the quotient
$$G(2^e)/((2\mathbf{Z}/2^e \mathbf{Z}) \times \{1\}) = (\mathbf{Z}/2\mathbf{Z}) \times (\mathbf{Z}/2^e\mathbf{Z})^{\times}$$
that maps {\em onto} $\mathbf{Z}/2\mathbf{Z} \times (\mathbf{Z}/4\mathbf{Z})^{\times}$ since we are in the
$D_4$-case. Likewise, since the projection
$H \rightarrow (\mathbf{Z}/2^e\mathbf{Z})^{\times}$ is surjective it must be an isomorphism for size reasons.
In other words, $H$ has to be the graph of a quotient map $q:(\mathbf{Z}/2^e\mathbf{Z})^{\times}
\twoheadrightarrow \mathbf{Z}/2\mathbf{Z}$, so $q$ factors through the quotient $(\mathbf{Z}/8\mathbf{Z})^{\times}$
modulo squares, and $q$ is one of the two such quotients which is not the reduction map
onto $(\mathbf{Z}/4\mathbf{Z})^{\times}$ (since $H$ maps onto $(\mathbf{Z}/2\mathbf{Z}) \times (\mathbf{Z}/4\mathbf{Z})^{\times}$).
Hence,
$$G = H_{q,e} := \{(x, u) \in (\mathbf{Z}/2^e\mathbf{Z}) \rtimes (\mathbf{Z}/2^e\mathbf{Z})^{\times}\,|\,q(u) = x \bmod 2\},$$
so the image of $G$ in $G(2^{e-1})$ has to be index 2 (since $e-1 \ge 3$
and $q(u)$ only depends on $u \bmod 8$), showing that this situation cannot arise when $G \rightarrow G(8)$
is surjective. This settles the case $e \ge 4$ when $G \rightarrow G(8)$ is surjective.

Assume instead that the image of $G$ in $G(8)$ is $H_{q,3}$ for one of the two quotients
$q:(\mathbf{Z}/8\mathbf{Z})^{\times} \twoheadrightarrow \mathbf{Z}/2\mathbf{Z}$ that is not the quotient
$(\mathbf{Z}/4\mathbf{Z})^{\times}$ (as we have seen is the case when
$e=3$). We claim that $G = H_{q,e}$, as has been shown above when $e=3$.

Let's first show that this would do the job
by proving $H := H_{q,e}$ has a unique index-2 subgroup containing $H \cap (\mathbf{Z}/2^e\mathbf{Z})^{\times} = 1 \times \ker q$.
Since $H$ contains $(2\mathbf{Z}/2^e\mathbf{Z}) \times \{1\}$, any index-2 subgroup contains
$4\mathbf{Z}/2^e\mathbf{Z}$, so we seek index-2 subgroups of $H = H_{q,e}$ containing the subgroup
$$(4 \mathbf{Z}/2^e \mathbf{Z}) \rtimes \ker q \supseteq (4 \mathbf{Z}/2^e \mathbf{Z}) \rtimes (1 + 8\mathbf{Z})/(1 + 2^e\mathbf{Z}).$$
Hence, the problem is reduced to the same for the image $H_{q,3}$ in $G(8)$ which we already handled by inspection.

It remains to prove that necessarily $G = H_{q,e}$ when $e \ge 4$.
Proceeding by induction, we may assume that the image of $G$ in $G(2^{e-1})$ is the index-2 subgroup $H_{q,e-1}$
(as we know to hold when $e-1=3$; i.e., when $e=4$)
Hence, $G \subset H_{q,e}$ and it has index 1, 2, or 4 in $H_{q,e}$; we want to show
that its index is 1. If the index is 4 then $G$ maps isomorphically onto $H_{q,e-1}$,
so all order-2 elements of $H_{q,e-1}$ admit
order-2 lifts in $G(2^e)$. Determination of all order-2 elements shows
that the image under the reduction map $G(2^e) \rightarrow G(2^{e-1})$ of the order-2 elements consists of
precisely the elements $(y,-1)$ with $y \in 2\mathbf{Z}/2^{e-1}\mathbf{Z}$. But
at least one of the order-2 elements $(0, \pm (1 + 2^{e-2})) \in G(2^{e-1})$ lies in $H_{q,e-1}$ (treat $e=4$ separately),
and neither has the form $(y,-1)$. Hence, $G$ has index 1 or 2 in $H_{q,e}$. We will rule out index 2, so
assume $G$ has index 2 in $H_{q,e}$.

The quotient map $H_{q,e} \rightarrow H_{q,e-1}$ is 4-to-1 with subgroup $G \subset H_{q,e}$
of index 2 that must be 2-to-1 onto $H_{q,e-1}$.
Let $C_e$ be the normal subgroup $2\mathbf{Z}/2^e\mathbf{Z} \subset H_{q,e}$, so $C_e$ is 2-to-1 onto
$C_{e-1} \subset H_{q,e-1}$. The induced quotient map
$H_{q,e}/C_e \rightarrow H_{q,e-1}/C_{e-1}$ is the 2-to-1 natural map
$\Gamma_{q,e} \rightarrow \Gamma_{q,e-1}$ between graphs, so it is identified with
the reduction map $\pi:(\mathbf{Z}/2^e\mathbf{Z})^{\times} \rightarrow (\mathbf{Z}/2^{e-1}\mathbf{Z})^{\times}$.
In particular, if $G$ contains $C_e$ then $G/C_e$ provides a splitting to $\pi$, which does not exist.
Thus, $G \cap C_e$ has index 2 in $C_e$, so passing to the quotient by the normal subgroup
$4\mathbf{Z}/2^{e-1}\mathbf{Z}$ that is 2-to-1 onto its image in $C_{e-1}$ gives an index-2 subgroup
$\overline{H}_{q,e} \subset (\mathbf{Z}/4\mathbf{Z}) \rtimes (\mathbf{Z}/2^e\mathbf{Z})^{\times}$
mapping 2-to-1 onto the analogous $\overline{H}_{q,e-1}$ and we have an index-2 subgroup
$\overline{G} \subset \overline{H}_{q,e}$ that maps onto $\overline{H}_{q,e-1}$
and hence provides a splitting. Thus, it is enough to show that the natural map
$\overline{H}_{q,e} \rightarrow \overline{H}_{q,e-1}$ has no splitting. Passing
to the quotient of each side by the normal subgroup $2\mathbf{Z}/4\mathbf{Z}$
gives the reduction map $\Gamma_{q,e} \rightarrow \Gamma_{q,e-1}$ that
we have already noted has no splitting.

4more comments