Let $|G|=p^n, p$ a prime, and let $|G:C_G(x)|\leq p$ for all $x \in G$. Then $|G'|\leq p$. 
Hi: I could solve (a) and (b). As for (c): Let $\phi:G\to G', \phi(x)=[x,y]$ for $y$ fixed. Then $\phi(gh)=[gh,y]=[g,y]^h[h,y]$. By (b) $[g,y]^h=[g,y]$ and then $\phi(gh)=[g,y][h,y]=\phi(g)\phi(h)$ and $\phi$ is homomorphism. Also $ker(\phi)= C_G(y)$ (easy). Now if $\phi$ were onto, then $G/C_G(y)$ isomorphic to $G'$ and then $|G'|\leq p$. Is $\phi$ onto? If it is I can't prove it.
The two preceding problems in this book are these:

I think they can help in the solution.
 A: I don't know whether this is what they want, but here's my attempt. Let $x\in G\setminus Z(G)$. As you have noted, the image of $\phi$ is a subgroup of $Z(G)\leq C_G(x)$ of order $p$, say $C_x=\langle z\rangle$. Notice that this means that if $y$ does not commute with $x$ then $[x,y]$ is a power of $z$.
So now let $y\in G\setminus C_G(x)$, and let $a\in G\setminus C_G(y)$. We see that $x$ and $a$ do not commute with $y$ either, so $[y,z]$ is a power of $z$ as well. Thus, for any pair of elements $x$ and $y$, that might commute, if there exists $a$ such that $[x,a]$ and $[y,a]$ are both non-trivial, then $C_x=C_y$. This obviously extends to a chain $x=a_0,\dots,a_r=y$ of elements, each non-commuting with the previous one.
Thus let $\sim$ be a relation on $G\setminus Z(G)$ given by $x\sim y$ if they do not commute (or $x=y$), and then extend $\sim$ transitively into an equivalence relation. If $x$ and $y$ lie in the same equivalence class then $C_x=C_y$.
I claim there is exactly one equivalence class. If $x\in G\setminus Z(G)$ then $|G:C_G(x)|=p$, and so there are at least $p^n-p^{n-1}$ elements in the equivalence class containing $x$, as there are this many elements not commuting with $x$. But there are only $p^n-p^m$ elements in total, where $|Z(G)|=p^m$. Thus there is no room for two or more classes.
Thus $C_x=C_y$ for all $x,y\in G\setminus Z(G)$, and the result holds.
A: At the risk of appearing presumptuous, I would like to present a complete solution to the problem. The inspiration will of course be taken from David Craven's approach (which is - as I also suspect - intimately related to the original proof obtained by Knoche, however I unfortunately have no access to his article), however I would like to bring clearer explanations for statements which are not fully justified in the above.
Let $n \in \mathbb{N}$ be a natural number, $p$ be a prime and $G$ a group of order $p^n$ such that for each $x \in G$ we have $\left(G \colon \mathrm{C}_G(x)\right) \leqslant p$. As indices of $p$-groups are necessarily powers of $p$, this applies in particular to the centralisers, such that for each $x \in G$ we have $\left(G \colon \mathrm{C}_G(x)\right)=p^k$, for a certain $k \in \mathbb{N}$. The condition that all indices of one-element centralisers are at most $p$ finally entails $k \leqslant 1$ and thus $\left(G \colon \mathrm{C}_G(x)\right) \in \{1, p\}$ for any $x \in G$. Since in any nilpotent group - which includes $p$-groups - a subgroup of prime index is necessarily normal, we derive two important conclusions:

*

*$\mathrm{C}_G(x) \trianglelefteq G$ for each $x \in G$ and

*the quotient $G/\mathrm{C}_G(x)$ is abelian (either trivial or cyclic of order $p$) for each $x \in G$.

If we denote by $\rho_x \colon G \to G/\mathrm{C}_G(x)$ the canonical surjection for each centraliser of arbitrary element $x \in G$, we consider the diagonal direct product of these morphisms $f \colon G \to \displaystyle\prod_{x \in G}G/\mathrm{C}_G(x)$ and remark that $\mathrm{Ker}f=\displaystyle\bigcap_{x \in G}\mathrm{Ker}\rho_x=\displaystyle\bigcap_{x \in G}\mathrm{C}_G(x)=\mathrm{C}_G(G)=\mathrm{Z}(G)$. This means that $f$ induces an injective quotient $g \colon G/\mathrm{Z}(G) \to \displaystyle\prod_{x \in G}G/\mathrm{C}_G(x)$, on the grounds of which we infer the quotient $G/\mathrm{Z}(G)$ is abelian (being embedded in the right-hand side group, which is also abelian). Since $\mathrm{D}(G)$ is the smallest normal subgroup inducing an abelian quotient, we gather the relation $\mathrm{D}(G) \leqslant \mathrm{Z}(G)$.
For arbitrary $x, y \in G$ let us write $[x, y]\colon=x^{-1}y^{-1}xy$ for the (left) commutator between $x$ and $y$ and let us also employ the notations ${}^tx\colon=txt^{-1}$ respectively $x^t=t^{-1}xt$ for the left respectively right conjugates of $x \in G$ by $t \in G$. Let us also recall the general relation $[xy, z]=[x, z]^y[y, z]$ and introduce - as both the original poster and David Craven have indicated - for each $t \in G$ the map:
$$\begin{align}
h_t \colon G &\to \mathrm{D}(G)\\
h_t(x)&=[x, t].
\end{align}$$
Since the derived subgroup is central, we infer that $[xy, t]=[x, t][y, t]$ for any $x, y, t \in G$ which means that $h_t \in \mathrm{Hom}_{\mathbf{Gr}}(G, \mathrm{D}(G))$ is a group morphism. Let us set $C_t \colon=\mathrm{Im}h_t$ and notice that $\mathrm{Ker}h_t=\mathrm{C}_G(t)$, so that by virtue of the fundamental isomorphism theorem $|C_t| \in \{1, p\}$. In particular, if $t \in G \setminus\mathrm{Z}(G)$ it follows that $|C_t|=p$.
We move on to remark that $x, y \in G$ are such that $[x, y]\neq 1_G$ we automatically have $x, y \in G \setminus \mathrm{Z}(G)$ and $[x, y] \in C_y \setminus \{1_G\}$ respectively $[y, x] \in C_x \setminus \{1_G\}$. Since $[x, y]=[y, x]^{-1}$, we gather that $[x, y] \in \left(C_x \cap C_y\right) \setminus \{1_G\}$ and since cyclic groups of prime orders are generated by any of their nontrivial elements we infer that $C_x=C_y$. By introducing $A \colon=G \setminus \mathrm{Z}(G)$ together with the binary relations $P, R \subseteq A \times A$ given by $xPy \Leftrightarrow [x, y] \neq 1_G$ respectively $xRy \Leftrightarrow C_x=C_y$, we can formulate this conclusion by stating $P \subseteq R$. The case $A=\varnothing$ is trivial as far as our problem is concerned so we assume that $A \neq \varnothing$ in what follows. This means we can write $|\mathrm{Z}(G)|=p^m$ for a certain $m \leqslant n-1$.
We also remark that $R$ is an equivalence and that $P$ is symmetric and irreflexive. Furthermore, let us consider elements $x, y \in P$ such that $P\langle x \rangle \cap P\langle y \rangle \neq \varnothing$, in other words such that there exists $z \in A$ with $[x, z], [y, z] \neq 1_G$. As $P$ is symmetric, we then automatically have $(x, y) \in P \circ P \subseteq R$. We use this remark to show that $R=A \times A$, in other words that for any two elements $x, y \in A$ we have $C_x=C_y$ and we proceed by establishing that necessarily $P\langle x \rangle \cap P\langle y \rangle \neq \varnothing$.
Assuming the contrary we would derive the existence of particular $a, b \in A$ such that $P\langle a \rangle$ and $P\langle b \rangle$ are disjoint. However, we have by definition that $P\langle x \rangle=G \setminus \mathrm{C}_G(x)$, hence $|P\langle x \rangle|=p^n-p^{n-1}$ for each $x \in A$. It would follow that $|P\langle a \rangle \cup P \langle b \rangle|=|P\langle a \rangle|+|P\langle b \rangle|=2\left(p^n-p^{n-1}\right) \leqslant |A|=p^n-p^m$. This cardinal relation leads – after rearrangement and simplification – to $p^{n-m} \leqslant 2p^{n-m-1}-1$, variant which can not hold for the following general reason: for any $k \in \mathbb{N}$ one has $2p^{k}-1 <2p^k \leqslant p^{k+1}$, and this applies in particular to $k=n-m-1$.
The previous argument shows that – having fixed a certain $a \in A$ – we have $C_x=C_a$ for every $x \in A$. Thus, for arbitrary $x, y \in G$ we have either $[x, y]=1_G \in C_a$ for trivial reasons or $[x, y] \neq 1_G$ which automatically means that $xPy$ and hence $C_x=C_y=C_a$. Since by construction $[x, y] \in C_y$ we once again infer that $[x, y] \in C_a$. It is then immediate that $\mathrm{D}(G) \leqslant C_a$ and as $G$ is not abelian (the centre being a proper subgroup) $\mathrm{D}(G) \neq \{1_G\}$. Since $C_a$ is cyclic of order $p$, it follows with necessity that $\mathrm{D}(G)=C_a$ and hence – in this case – $|\mathrm{D}(G)|=p$.
