Solution (source code)

= Solution

Use integral coefficients throughout, allowing a nontrivial orientation character. A dimension-$d$ <Poincare duality group> has a finite resolution by finitely generated projective group-ring modules and
$$
H^j(G;\mathbb ZG)=0\quad(j\ne d),\qquad H^d(G;\mathbb ZG)\cong\mathbb Z
$$
as <abelian groups>. The action on the top copy of $\mathbb Z$ may be by signs. This group-ring criterion is particularly suited to the <Lyndon–Hochschild–Serre spectral sequence>.

Apply that sequence to the extension with coefficient module $\mathbb ZG$:
$$
E_2^{a,b}=H^a\bigl(Q;H^b(N;\mathbb ZG)\bigr)
\Longrightarrow H^{a+b}(G;\mathbb ZG).
$$
As an $N$-module, $\mathbb ZG$ is a <direct sum> of copies of $\mathbb ZN$ indexed by the cosets in $Q$. <Cohomology> of $N$ commutes with this <direct sum> because its <projective resolution> is finitely generated. Hence the inner <cohomology> vanishes except when $b=n$, where it is a <direct sum> of rank-one groups indexed by $Q$. The $Q$-action shifts these summands freely and transitively, with possible signs from the orientation module. Choosing a generator in one summand and transporting it by $Q$ identifies the resulting left $Q$-module with its regular module $\mathbb ZQ$. The residual right <group action> records the orientation twist; it need not be trivial.

Now the duality of $Q$ says that the only nonzero $E_2$ term is $(a,b)=(q,n)$ and that this term is $\mathbb Z$ as an <abelian group>. No differential can enter or leave it. Therefore $H^*(G;\mathbb ZG)$ has exactly the duality pattern in degree $n+q$. The usual extension-resolution construction also supplies a resolution by <finitely generated projective modules>: combine the finite <kernel> and quotient resolutions, lift the quotient differentials and add the necessary <homotopy> corrections. Its total length is at most $n+q$. Alternatively, the same <spectral sequence> for arbitrary coefficient modules gives the dimension bound, while the extension finiteness lemma supplies finite generation of the resolution. The surviving top term makes the bound sharp. This proves the <extension rule for Poincare duality groups>:
$$
\boxed{G\text{ is a }PD^{n+q}\text{ group}.}
$$
Requiring a trivial top orientation action would need an additional orientation condition; the untwisted conclusion is not implicit in the hypotheses.

We next need two precise auxiliary dimension results. The <Strebel infinite-index subgroup theorem> says that an infinite-index subgroup of an integral $PD^d$ group has <integral cohomological dimension> at most $d-1$. The <Stallings-Swan theorem> says that a group of <integral cohomological dimension> at most one is free, including the trivial group. Since $G/N$ contains an element of infinite order, $N$ has infinite index in $G$, so $\operatorname{cd}N\leq2$. If its dimension is at most one, the required free-group conclusion follows, with finite rank because $N$ is finitely presented.

Suppose instead that $\operatorname{cd}N=2$. <Finite presentation> gives a partial <free resolution> with finitely generated modules through degree two. The <kernel> in degree one is finitely generated and, because the <integral cohomological dimension> is two, projective. Truncating at this <kernel> gives a finite resolution by <finitely generated projective modules>. Thus $N$ has the finiteness needed for group-ring <cohomology> to commute with <direct sums>.

Choose an infinite-order element $\bar t\in G/N$, lift it to $t\in G$, and let $H$ be the preimage of $\langle\bar t\rangle$. Then $H=N\rtimes\langle t\rangle$. Restriction of $\mathbb ZH$ to $N$ yields copies of $\mathbb ZN$ indexed by all powers of $t$. For every $j$, the quotient generator acts on $H^j(N;\mathbb ZH)$ by shifting this <direct sum>, possibly with an automorphism on each copy. Its invariants vanish, since an invariant finite-support sequence must be zero. Its coinvariants are one copy of $H^j(N;\mathbb ZN)$: the shift relations identify successive copies, and any twists can be removed by transporting the identifications along the integer index.

The <infinite cyclic group> has <integral cohomological dimension> one, so only columns zero and one occur in the <spectral sequence>. Column zero vanishes and column one consists of these coinvariants. We obtain the <cyclic-extension shift of group-ring cohomology>
$$
H^{j+1}(H;\mathbb ZH)\cong H^j(N;\mathbb ZN)
$$
as <abelian groups>. Moreover $H^2(N;\mathbb ZN)\ne0$. Here is a useful proof of that last point: if top <cohomology> of a finite <projective resolution> were zero, its last dual differential would be onto. Its target is projective, so that differential splits. Dualizing back splits the last injection of the original resolution, shortening it and contradicting <integral cohomological dimension> two.

It follows that $H^3(H;\mathbb ZH)\ne0$, and hence $\operatorname{cd}H=3$. Strebel's theorem forces $H$ to have finite index in $G$. It is therefore itself a $PD^3$ group, by <finite-index invariance of Poincare duality for torsion-free groups>. The displayed shift now makes $H^j(N;\mathbb ZN)$ zero except for $j=2$, where it is $\mathbb Z$. Together with its finite <projective resolution>, this proves
$$
\boxed{N\text{ is either free or a }PD^2\text{ group}.}
$$
The <classification of two-dimensional Poincare duality groups> identifies the latter with the <fundamental group> of a closed <aspherical> surface. This classification includes orientation-twisted <surface groups>; it does not include the two-sphere or real projective plane, whose <fundamental groups> do not have <integral cohomological dimension> two.

In this latter case we have also proved that $G/N$ is virtually infinite cyclic, since $H/N=\langle\bar t\rangle$ has finite index. If necessary replace the <surface group> by its characteristic index-two orientable subgroup and take the subgroup generated by it and $t$. This still has finite index in $G$ and is a semidirect product of an orientable closed <aspherical> <surface group> by $\mathbb Z$. The <Dehn-Nielsen-Baer theorem for closed orientable surfaces> realizes the <outer automorphism> defined by conjugation by $t$ as a surface <homeomorphism> $f$. For the <torus> this is just realization of $GL_2(\mathbb Z)$ by linear <homeomorphisms>. Changing the chosen lift accounts for an <inner automorphism>. The <mapping torus>
$$
M_f=(S\times[0,1])/((x,1)\sim(f(x),0))
$$
is a surface bundle over $S^1$ with <fundamental group> $\pi_1(S)\rtimes_{f_*}\mathbb Z$. Thus \b[a <finite-index subgroup> of $G$ is the <fundamental group> of a surface fibration over the circle]. Taking a further double cover of the base if required makes the <monodromy> orientation-preserving.