Show that $(x-1)^2$ is a factor of $x^n -nx +n-1$
By factor theorem we know that $(x-a)$ is a factor of $f(x)$ if $f(a)=0$.
In this case, $f(x)=x^n -nx +n-1 \implies f(1)=0$
Hence we conclude that $(x-1)$ is a factor. From hereon, how can I say that $(x-1)^2$ is a factor?
Can we approach the problem without calculus approach? This problem was taken from a book of pre-calculus algebra.
Since calculus and double root test are not known, we can instead divide by $\,x\!-\!1\,$ twice as follows.
Note that $\,x\!-\!1$ divides $f(x)=(\color{#c00}{x^n-1})-\color{#0a0}n(x-1)\ $ by $\, f(1)= 0\,$ and the Factor Theorem.
$x\!-\!1$ divides $g(x) := \dfrac{f(x)}{x\!-\!1} = (\color{#c00}{x^{n-1}+\cdots+1})-\color{#0a0}n\ $ by $\ g(1) =n-n=0\,$ similarly.
So we infer $\,\ g(x) = \dfrac{f(x)}{x\!-\!1} = (x\!-\!1)\,h(x)\,$ for some polynomial $\,h(x).$
Hence we conclude $\ \ f(x)\, = (x\!-\!1)^2h(x)\ $ by scaling above by $\,x\!-\!1.$