I'm having trouble with the following question: Let $G$ be a finite group acting on a finite set $X$. For $g\in G$, let $Fix_X(g) =\{x\in X \mid xg = x\}$ and, for $x\in X$, let $G_x = \{g\in G \mid xg = x\}$. Prove that $\frac{1}{|G|}\sum\limits_{g\in G} |Fix_X(g)|$ is the number of orbits of $X$ under $G$.
[Hint: let $P = \{(x, g) \mid xg = x\} \subseteq X\times G$ and do a double count: calculate the number $\frac{|P|} {|G|}$ as a sum over $X$ and as a sum over $G$.]
Using the hint I have got that $\frac{|P|}{|G|}=\frac{\sum\limits_{g\in G} |Fix_X(g)|}{|G|}=\frac{\sum\limits_{x\in X} |G_x|}{|G|}$ and have replaced the $\frac{|G_x|}{|G|}$ for each $x$ by $\frac{1}{|O_G(x)|}$. After here I'm stuck. Could someone please point me in the right direction? Thanks