# Groups of prime power and the fixed point set

Suppose that $X$ is a finite $G$-set. A group $G$ is of prime power if $|G|=p^n$ for $p$ prime.

The fixed point set $X_G=\{x\in X : gx=x$ $\forall g\in G\}$.

I'm asked to prove that $|X|=|X_G|$ (mod $p$), but I'm unsure of how I should start.

Note that $G$ acts on $X-X_G$, and $p$ divides the size of every orbit in $X-X_G$ by the Orbit Stabilizer Theorem, hence $p$ divides $|X-X_G|$, i.e. $|X|$ and $|X_G|$ are congruent modulo $p$.
Remember for each $x \in X$, denoting $G_x = \{g\in G : gx=x\}$ and $O_x = \{y\in X | \exists g\in G : gx = y\}$, a well known theorem in Group Theory claims that $|O_x| = \frac{|G|}{|G_x|}$.
Notice that $|O_x|=1$ iff $x\in X_G$. If $|O_x|>1$ then, since $|O_x| \mid |G|$, we have that $p \mid |O_x|$. Now, since the orbits are a partition of $X$, we have that $|X|=\sum_i |O_i|$.
Taking this equation mod p, all $O_i$'s such that $|O_i|>1$ disappear, since $p \mid |O_i|$. We are only left with those such $|O_i|=1$. How many do we have of those? Exactly $|X_G|$ (as $|O_x|=1$ iff $x\in X_G$). So we are done.
Hint: To show this, you have to remark that if $x$ is not fixed by $G$, the cardinal of $Orb_x$ the orbit of $x$ is $\mid Orb_x\mid =\mid G\mid/\mid G_x\mid$ Where $G_x$ is the subgroup of elements of $G$ which fix $x$. Lagrange implies that $\mid G_x\mid$ divides $\mid G\mid$ so $\mid Orb_x\mid =0$ mod p since $G_x\neq G$. The results follows from the fact that the cardinal of $X$ is the sum of the cardinal of the orbits of $G$. $\mid G\mid =\sum \mid X_G\mid+\sum_{x: G_x\neq G}\mid Orb_x \mid$ since $\mid Orb_x\mid =0$ mod $p$, $\mid X_G\mid =mid X\mid$ mod p.