I have to find $gcd(x^{P-1}-1,x^2+1)$ in $\Bbb{Z}/p\Bbb{Z}[X]$ for some prime number p in order to show that $-1$ is a square $\pmod p$ iff $p\equiv1\pmod4$. I really have no idea where to start. I don't see how to get the gcd given that p is not a number. Any help would be appreciated.
Thanks