TITLE: $G$ finite group, $H\leq G$ such that $C_G(x)\subseteq H\quad\forall x\in H$ such that $p\mid o(x)$
QUESTION [8 upvotes]: Suppose $G$ is a finite group and fix a prime $p$. 
Let $H\leq G$ have the property that $C_G(x)\subseteq H$ whenever $x$ is an element of $H$ whose order is $p^\alpha, \alpha>0$ an integer. Then prove that $p$ cannot divide both $|H|$ and $|G:H|$.
I'm asking you to lend me an hand since it seems I'm stuck on the problem.
Thank you very much.

REPLY [4 votes]: Here is what I was suggesting in my comment:
The problem is vacuous, as Arturo mentions, if $p$ does not divide $|H|$.  So suppose it does, and let $P$ be a Sylow p-subgroup of $G$ intersecting $H$ non-trivially.  Let $x\in P\cap H$ be a non-trivial element of the intersection.  Then we have, by the hypothesis,
$$ Z(P)\subset C_P(x)\subset C_G(x)\subset H.$$
Since $Z(P)$ is non-trivial, take a non-trivial $y\in Z(P)$; then again, since $Z(P)\subset H$, we have
$$ P\subset C_P(y)\subset C_G(y)\subset H,$$
and so $H$ contains a Sylow p-subgroup of $G$, implying that $[G:H]$ is not divisible by $p$.