Let $G$ be a finite group. Suppose that there exists $n\in\mathbb N_0$ such that $G_n=G_{n+1}$ and $Z(G)=1$. Show that $C(G_n)\subseteq G_n$. 
Let $G$ be a finite group. Recursively define the sequence $G_1=G$ and $G_{n+1}=[G_n,G]$. Suppose that there exists $n\in\mathbb N_0$ such that $G_n=G_{n+1}$ and $Z(G)=1$. Show that $C(G_n)\subseteq G_n$.

Here, $C(G_n)$ denotes the centralizer of the subgroup $G_n$.
My attempt: I first showed that $G/G_n$ is nilpotent and then that there exists a nilpotent subgroup $H$ of $G$ such that $G=HG_n$. Assume the result is false, then $C(G_n)G_n/G_n$ is a non-trivial normal subgroup of $G/G_n$. Nilpotency of the latter implies that $$[C(G_n)G_n/G_n,G/G_n]\neq C(G_n)G_n/G_n.$$ Thus, $$[C(G_n)G_n,G]/G_n\neq C(G_n)G_n/G_n$$
and so $[C(G_n)G_n,G]\neq C(G_n)G_n $.

I can't proceed from here.
 A: This exercise seems difficult. Here is an attempt at a proof, but I have an feeling that I am missing something, and there should be a simpler proof. Or perhaps your teacher has already taught you some related result that could be applied here?
Let $N = G_n$ (to simplify typing) and $C=C_G(N)$, and assume that $C \not\le N$.
Since $C \cap N \le Z(C)$ and $C/C\cap N \cong CN/N$ is nilpotent, $C$ is also nilpotent. Choose a prime $p$ such that $p$ divides $|CN/N|$, and let $Q \in {\rm Syl}_p(C)$. Then $Q \unlhd G$.
Now, since $G/N$ is nilpotent, $QN/N$ has nontrivial intersection with $Z(G/N)$. Choose $D$ with $N \cap Q \le D \le Q$ such that $DN/N \le Z(G/N)$ and $|DN/N| = p$. Then $D \unlhd G$. Also, since $|D/D \cap N| = p$ and $D \cap N \le Z(D)$, it follows that $D$ is abelian.
Let $D \le P \in {\rm Syl}_p(G)$, and let $A$ be the inverse image in $G$ of the maximal $p'$-subgroup of $G/N$: so $G/N = A/N \times PN/N$.
Now $A$ is acting (by conjugation) as a $p'$-group of automorphisms of $D$ so, by a standard result, $D = C_D(A) \times [A,D]$.
You can also check that $C_{D \cap N}(A)$ is normal in $P$. If $C_{D \cap N}(A)$ is nontrivial, then it has nontrivial intersection with $Z(P)$; but its intersection with $Z(P)$ lies in $Z(G)$ so, by the hypothesis $Z(G)=1$, we must have $C_{D \cap N}(A) = 1$.
On the other hand, $A$ centralizes $D/D \cap N$, so $[A,D] \le D \cap N$, and hence we must have $|C_D(A)| = p$ with $C_D(A) \cap N = 1$. Now $C_D(A)$ is also normal in $P$ and hence has nontrivial intersection with $Z(P)$, and we get $C_D(A) \le Z(G)$, contradiction.
So $C_G(N) \le N$ as claimed.
