<s>[INST] Show that exactly half of $1^{\frac{p-1}{2}}, 2^{\frac{p-1}{2}}, \dots, (p-1)^{\frac{p-1}{2}}$ are congruent to 1 modulo $p$ 
Let $p$ be an odd prime number. Look at the numbers in the set
  \begin{align*}
S \in \{1^{\frac{p-1}{2}}, 2^{\frac{p-1}{2}}, \dots, (p-1)^{\frac{p-1}{2}}\}
\end{align*}
  Show that exactly half of these numbers are congruent to 1 modulo $p$. 

I define two polynomials 
\begin{align*}
&f(x) = x^{\frac{p-1}{2}} - 1 \\
&g(x) = x^{\frac{p-1}{2}} + 1
\end{align*}
According to Lagranges theorem, the congruences
\begin{align*}
&f(x) \equiv 0 \pmod{p} \\
&g(x) \equiv 0 \pmod{p}
\end{align*}
or 
\begin{align*}
&x^{\frac{p-1}{2}} \equiv 1 \pmod{p} \\
&x^{\frac{p-1}{2}} \equiv -1 \pmod{p}
\end{align*}
will have maximum $\frac{p-1}{2}$ slutions each. Thus, we can say that maximum half of the numbers in $S$ will be congruent to either 1 or -1 modulo $p$. How can I show that exactly half of the numbers are congruent to 1 or -1 modulo $p$?
 [/INST] Recall that each of $1, \dots, p-1$ is a root of $X^{p-1}-1$. 
Now as you alluded to $X^{p-1}-1 = (X^{(p-1)/2} -1)(X^{(p-1)/2} +1)$. 
This means that for each $a=1, \dots, p-1$:  
$$(a^{(p-1)/2} -1)(a^{(p-1)/2} +1)=0$$ 
thus at least one of the two $(a^{(p-1)/2} -1)$ and $(a^{(p-1)/2} +1)$ is zero, and of course not both can be equal to $0$. 
Thus for each $a=1, \dots, p-1$ exactly one of $(a^{(p-1)/2} -1)$ and $(a^{(p-1)/2} +1)$ is zero. 
As you observed correctly for each of $(X^{(p-1)/2} -1)=0$ and $(X^{(p-1)/2} -1)=0$ there can be at most $(p-1)/2$ solutions. 
Yet together this means that $(X^{(p-1)/2} -1)=0$ and $(X^{(p-1)/2} -1)=0$ both have exactly $(p-1)/2$ solutions. 
You know each of $p-1$ is a solution to one of the two, and each can have at most $(p-1)/2$ solution, whence the only way is both have exactly $(p-1)/2$ solutions.  
</s>