If $K\rtimes \mathbb{Z}$ is a finitely generated group but $K$ isn't, must the fixed points of $1_\mathbb{Z}$ be a finitely generated group? I've copied over this question from what I asked on StackExchange, in the hope that an expert here can readily answer the question.
Is there an example of a group $G=K\rtimes \mathbb{Z}$ satisfying the following three conditions?

*

*$G$ is finitely generated;

*$K$ is not finitely generated;

*the fixed points of $\phi(1)$, which is the automorphism on $K$ corresponding to $1_\mathbb{Z}$, are not a finitely generated group.

I suspect there is an example, but I don't have enough experience with infinite groups to come up with one right away.
$\\\\$
One idea, which may or may not work:
finding matrices $M_1,\ldots,M_k\in\text{GL}_n(\mathbb{C})$ and $g\in\text{GL}_n(\mathbb{C})$
such that $S=\langle g^{-n}\,M_j\,g^n\rangle_{1\leq j\leq k,\;n\in\mathbb{Z}} $ is not finitely generated
but such that $g$ commutes with surprisingly many matrices in $S$.
 A: Here is another example, which I am fond of, because it played a role in a PhD thesis of a student that I supervised a long time ago.
It is constructed as a central extension of $C_p \wr {\mathbb Z}$ for a prime $p$.
The subgroup $K$ is generated by elements $x_i,y_k$ with $i,k \in {\mathbb Z}$ and $k > 0$, and it has defining relations
\begin{eqnarray*}
 x_i^p  &=& y_j^p= 1\ \mbox{for all}\ i,j,\\
[x_j,x_i] &=& y_{j-i}\ \mbox{for}\ j>i,\\ 
[y_k,x_i] &=& 1\ \mbox{for all}\ i,k,
\end{eqnarray*}
so it is nilpotent of class $2$ with $K$ and $K/Z(K)$  both infinite elementary abelian, where $Z(K)$ is generated by the elements $y_k$.
Now we define the action of $({\mathbb Z},+)$ on $K$ to make the element $1 \in {\mathbb Z}$ map $x_i$ to $x_{i+1}$ for all $i \in {\mathbb Z}$. So the induced action on $Z(K)$ is trivial.
Now let $G$ be the semidirect product $K \rtimes {\mathbb Z}$. Then $G$ is generated by $x_0$ and $1 \in {\mathbb Z}$, but $K$ and $Z(G) = Z(K)$ are not finitely generated.
A: No. Fix $p\ge 2$. Take the group
$$G=\{M(x,y,z;n):(x,y,z)\in\mathbf{Z}[1/p],n\in\mathbf{Z}\}$$where $$M(x,y,z;n)=\begin{pmatrix}1 & x & z \\ 0 & p^n & y\\ 0 & 0 & 1\end{pmatrix}$$
and $K$ the set of such $M(x,y,z;n)$ for $n=0$, and identify $\mathbf{Z}$ to powers of $M(0,0,0,1)$.
Then $G$ is finitely generated (namely by $\{M(0,0,0;1),M(1,0,0;0),M(0,1,0;0)\}$), $K$ is not finitely generated, and indeed the centralizer of $M(0,0,0;1)$ in $K$ is not finitely generated (isomorphic to the abelian group $\mathbf{Z}[1/p]$).
