Sometimes, just taking things straightforward can help. You are computing a "greatest common divisor", so understanding the divisors -- that is, the factors -- of $g(x)$ and $x^p - x$ is likely to be very useful, assuming you can say something about them.
So that's a place to start trying to approach the problem.
You might do research: e.g. your textbook might say something about $x^p - x$ or $\gcd(x^p - x, g(x))$ or maybe just about general polynomials over this field that you could use to solve this problem.
There are surely many different places to start. Pick any of them and try to learn more about the problem: maybe you'll see a path to the solution, or maybe just something interesting or useful, or you might go nowhere at all. You won't know until you try, though.
And you can work backwards: knowing what you are supposed to prove, you can guess as to exactly what the divisors of $x^p -x $ should be (if you don't know already and can't figure it out more directly).