Hint $ $ By little Fermat and the Lemma below $\,x^{p-1}-1 = (x\!-\!1)(x\!-\!2)\cdots (x-(p\!-\!1))g(x)\,$ so comparing degree and lead coefficient shows $\,g(x) = 1.\,$ [Beware: it is not generally true that if $\,a\neq b\,$ are roots of $\,f(x)\,$ then $\,(x\!-\!a)(x\!-\!b)\mid f(x),\, $ so it requires proof - see the Remark below].
Lemma $ $ If $\,f(a_i)=0\,$ and $\,a_i-a_j\,$ is cancellable for $\,i\neq j\,$ then $\,(x\!-\!a_1)\cdots(x\!-\!a_n)\mid f(x)$
Proof $ $ Induct on $\,n.\, $ If $\,n=1\,$ then $\,f(a_1)=0\,\Rightarrow\, x\!-\!a_1\mid f(x)\,$ by the Factor Theorem. Else by induction $\, f = (x\!-\!a_1)\cdots(x\!-\!a_{n-1}) g(x)\,$ so $\,0 = f(a_n) = (a_n\!-\!a_1)\cdots(a_n\!-\!a_{n-1}) g(a_n)\, $ thus $\, g(a_n)=0$ by cancelling all $\,a_i-a_j,\,$ so $\,x\!-\!a_n\mid g(x)\,$ by the Factor Theorem, yielding the claim.
Remark $ $ In a field (or domain) we have $\,c\,$ is cancellable $\iff c\neq 0\,$ so the above hypothesis reduces to $\,a_i\neq a_j\,$ if $\,i\neq j,\,$ i.e. the $\,a_i\,$ are distinct roots. The cancellability hypothesis is necessary, e.g. over $\,\Bbb Z_{\large 8}\!:\ x^2-1\,$ has roots $\,3,1\, $ but is not divisible by $\,(x\!-\!3)(x\!-\!1).\,$ Note $\,3-1 = 2\,$ is not cancellable since $\,2\cdot 4= 2\cdot 0\,$ but $\,4\neq 0,\,$ so the Lemma does not apply.
Alternatively we could use $\,x-a\,$ and $\,x-a'\,$ are nonassociate primes if $\,a\neq a',\,$ so since $\,x^{p-1}-1\,$ is divisible by those nonassociate primes it it is also divisble by their lcm = product.