If $C_G(x) \leq H$ for every $p$-element $x \in H$, then $p$ cannot divide both $|H|$ and $|G:H|$ This is problem 1.D.2 in Isaacs, Finite Group Theory. I am self-studying, so would appreciate a proof verification.
Note: in this book, all groups are assumed finite unless otherwise stated.

Fix a prime $p$, and suppose that a subgroup $H \leq G$ has the property that $C_G(x) \leq H$ for every element $x \in H$ having order $p$. Show that $p$ cannot divide both $|H|$ and $|G:H|$.

My proof: Suppose that $p$ divides both $|H|$ and $|G:H|$. Let $P \in Syl_p(H)$. Since $p$ divides $|G:H|$, we see that $P$ cannot be in $Syl_p(G)$ (its order is too small), but it must be contained in some $Q \in Syl_p(G)$.
Let $N = N_Q(P)$. Since $P < Q$ and $Q$ is a $p$-subgroup, we have $P < N \leq Q$ since "normalizers grow" in finite $p$-groups (because they are nilpotent).
Let $N$ act on $P$ by conjugation. Suppose that $y \in P$ is a nonidentity element which is fixed by this action, i.e., $\{y\}$ is a one-point orbit. Then every element of $\langle y \rangle$ is also fixed, since, for example, $gy^2g^{-1} = (gyg^{-1})(gyg^{-1}) = y^2$. Since $\langle y \rangle$ is a $p$-subgroup, it contains some $x$ of order $p$. Since $x$ is fixed by the action, it is centralized by $N$. This means that $N \leq C_G(x)$. Since $C_G(x) \leq H$ by hypothesis, we have $P < N \leq H$. But this is impossible because $P \in Syl_p(H)$ and $N$ is a $p$-subgroup which properly contains $N$. We conclude that $1$ is the only fixed point in this action.
Now by the orbit-stabilizer theorem, we have $|P| = 1 + \text{stuff divisible by }p$. Taking this equation modulo $p$, we obtain the contradiction $0 \equiv 1 \mod p$.
 A: Your proof looks good! Here is another one. Assume $p$ divides $|H|$. We will show that $p$ cannot divide $|G:H|$. Let $P \in Syl_p(H)$, which exists and is non-trivial, since $p \mid |H|$. Put $\Omega = \{x \in P : \text { order}(x)=p\}$. Then $|\Omega| \equiv -1 $(mod $p$) (this follows from the McKay proof of Cauchy's Theorem).
$N_G(P)$ acts on $\Omega$ by conjugation. Let $\{x_1, \cdots, x_n\}$ be a set of representatives of the orbits of this action. Then
$$|\Omega|=\sum_{i=1}^{n}|N_G(P):C_{N_G(P)}(x_i)|.$$
Since $C_G(x_i) \subseteq H$ by assumption, we have for every $i$:
$$C_{N_G(P)}(x_i)=C_G(x_i) \cap N_G(P) \subseteq H \cap N_G(P)=N_H(P).$$
In particular $|N_G(P) : N_H(P)|$ divides $|N_G(P) : C_{N_G(P)}(x_i)|$ for every i, whence $|N_G(P) : N_H(P)|$ divides $|\Omega|$.
Then since $|\Omega| \equiv -1$ (mod $p$), $|N_G(P) : N_H(P)|$ cannot be divisible by $p$. On the other hand, $|N_H(P) : P|$ is not divisible by $p$ as $P \in Syl_p(H)$, so $p$ does not divide $|N_G(P) : N_H(P)| \dot |N_H(P) : P| = |N_G(P) : P|$.
Finally (see Exercise 1.A.10 is Isaacs' book!), $|N_G(P):P| \equiv |G:P|$ mod $p$. Therefore $p$ cannot divide $|G:H|$.
