Let $f(x) = (x^n-1)/(x-1)$. Why does $f(1)=n$? In the back of De Souza (Berkeley Problems in Mathematics, page 305), it says:

For $x \neq 1$,
  $$
f(x) = (x^n-1)/(x-1) = x^{n-1} + \cdots + 1
$$
  so $f(1) = n$.

The expansion for $x \neq 1$ obviously follows from the definition of a partial geometric series. But since it requires $x \neq 1$, how can it follow that $f(1)=n$?
Edit: $f$ is defined as above as a polynomial. I think this changes the question since if $f$ is given as a polynomial, it must then be continuous. The only way for $f$ to be continuous is to define $f(1)=n$. Someone else can confirm if this is correct reasoning.

This has been said in a similar fashion above, but I've already typed it out...
For $x\neq 0$ you have 
$$\frac{1}{1-x}=\sum_{k=0}^\infty x^k.$$
So
$$(1-x^n) \frac{1}{1-x} = \sum_{k=0}^\infty x^k- x^n\sum_{k=0}^\infty x^k= \sum_{k=0}^\infty \left(x^k-x^{n+k}\right)=\sum_{k=0}^{n-1}x^k=\sum_{k=1}^{n}x^{k-1}.$$
With $x=1+\epsilon$ and $\epsilon\neq 0$, this becomes
$$=\sum_{k=1}^{n}(1+\epsilon)^{k-1}=\sum_{k=1}^{n}(1+{\mathcal O}(\epsilon))=n+{\mathcal O}(\epsilon).$$
Here the limit $x$ to $1$ resp. $\epsilon$ to $0$ is clearly $n$.
