Is a centerless finite group perfect? Large symmetric groups fail me. But how far are centerless groups from being perfect? I mean except how many cases by how far.
 A: Complementing Kaj's example with the following list of examples of groups $G_p$, indexed by prime numbers $p$, such that:


*

*the center of $G_p$ is trivial, and

*the commutator $[G_p,G_p]$ is of index $p$ in $G_p$.


The construction is simple. Let $q$ be a bigger prime satisfying the congruence $q\equiv1\pmod p$. Such primes exist. The big hammer for this is Dirichlet's theorem of primes on arithmetic progressions. I will swing that for the sake of brevity.
Because the multiplicative group $\Bbb{Z}_q^*$ is cyclic of order $q-1$ it has an element $a$ of order $p$. Let's define the semidirect product
$$
G_p=C_q\rtimes C_p,
$$
where a generator $z$ of $C_p$ acts on $C_q$ via $zxz^{-1}=x^a$ for all $x\in C_q$. In other words, we use the homomorphism $\phi:C_p\to\operatorname{Aut}(C_q)\simeq \Bbb{Z}_q^*$ defined by $\phi(z^i)=a^i$ for all $i$ to construct the semi-direct product.
So we have the decomposition series
$$
\{1\}\unlhd C_q\unlhd G_p.
$$
Let's check the claims:


*

*Because $a$ has order $p$ no non-trivial power of $z$ commutes with $C_q$. Therefore $C_q$ is its own centralizer in $G_p$. Consequently the center of $G_p$ is trivial.

*The quotient group $G_p/C_q\simeq C_p$ is abelian, so $[G_p,G_p]\le C_q$. As $G_p$ is not abelian, the commutator subgroup must be all of $C_q$. Therefore $[G:G_p']=p$ as claimed.



If $n=\prod_{i=1}^kp_i^{a_i}$ is any positive integer we can use the above construction and consider the finite group
$$
G=G_{p_1}^{a_1}\times G_{p_2}^{a_2}\times\cdots\times G_{p_k}^{a_k}
$$
as an example of group such that $Z(G)$ is trivial, and $[G:G']=n$.
A: Not necessarily.  One can show that $S_3$ has trivial center$^\dagger$.
We can also show that the commutator subgroup of $S_3$ is not $S_3$ itself by recalling that the commutator subgroup of a group $G$ is the smallest normal subgroup for which $G/N$ is abelian.  Note that $A_3$ is normal in $S_3$ due to it having index $2$, and $S_3/A_3 \cong \mathbb{Z}_2$, an abelian group.  
Therefore, the commutator subgroup of $S_3$ is $A_3$ (because $A_n$ is the only normal subgroup of $S_n$ whenever $n \neq 4$), so $S_3$ is not perfect.

Edit: This works for all $S_n$, $n \geq 3$.
$^\dagger$ I prove this result in greater generality here.
A: There are actually infinitely many groups, that are not only counterexamples to your statement, but simultaneously posses two properties stronger than aforementioned ones. Those are complete metabelian groups $Hol(C_{2n + 1})$ (here $Hol$ stands for holomorph)
They are metabelian (and thus non-perfect) by their construction.
They are complete (and thus centerless) as shown in the answer to the following question: Is the statement that $ \operatorname{Aut}( \operatorname{Hol}(Z_n)) \cong \operatorname{Hol}(Z_n)$ true for every odd $n$?
