If $H \leq Z(G) \leq G$, where G is a finite group, $Z(G)$ is its center, and $(G:H) = p$ for some prime $p$, then G is abelian.
Well because H < Z(G) we have that H commutes with all of G. Also |G/H|=p. I was thinking of connecting this result to the fact that if $G/Z(G)$ is cyclic, then $G$ is abelian, but was unable to. Then I thought about using the result that $(G/H)/(Z(G)/H) = G/Z(G),$ but that leads to nowhere. Any suggestions?
If $H\le Z\le G$ then $[G:Z]$ divides $[G:H]=p$ which means $[G:Z]=1$ or $p$. The second case implies $[Z:H]=[G:H]/[G:Z]=p/p=1$ so that $Z=H$, hence $G/Z(G)$ is a group of prime order, hence $G/Z(G)$ is nontrivial cyclic, which is impossible (well-known exercise). The first case is precisely that $G=Z(G)$ which means $G$ is abelian.