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.
 A: I think what you want to say is
$$\lim_{x \to 1} f(x) = n$$
The reason is that, when $x \ne 1$, we may rewrite $f(x)$ as
$$x^{n-1} + x^{n-2} + \cdots +x +1$$
and now, because this form is continuous at $x=1$, we may extend the definition of the function to include $x=1$, which is $1+1+\cdots+1+1 = n$.
A: I think we can all agree that "$f(1)$ does not exist" is a true statement (if not then state the reason), therefore if "$f(1)=1$" is a statement then it is a mistake, otherwise if it is meant to be "redefine $f(1)$ to be equal 1" for whatever reason (e.g. to make the function continuous everywhere since 1 is a removable discontinuity) then it is an instruction on how to achieve that.
It is most like likely used as an instruction than a statement, very often authors do not make it clear weather they are stating a fact or redefining something specifically and inflict confusion on the reader, after while it becomes a habit of the reader to figure out the correct interpretation.
Update : To be exact, let's separate what is being said here:
$f_1(x) = (x^n-1)/(x-1)$ and $f_2(x) = x^{n-1} + \cdots + 1$
To be precise $f_1 \neq f_2$ by definition of equality since we can show that $f_1(1)$ does not exist and $f_2(1)=1$ therefore $f_1 \neq f_2$.
What we have shown is that there is a difference between $f_1$ and $f_2$ so they are not the same thing.
Two functions can have the same values for a given domain, so for $x\neq 1$, values of $f_1$ and $f_2$ are equal, but the functions themselves are not the same thing, i.e. $f_1 \neq f_2$.
more on this at https://en.wikipedia.org/wiki/Analytic_continuation
A: Another interpretation is that we want to make $f$ continuous at $x=1$:
$$
f(1)
= \lim_{x \to 1} f(x)
= \lim_{x \to 1} \frac{x^n-1}{x-1}
= g'(1)
= n
$$
with $g(x)=x^n$.
A: so must be replaced by and, then we can say "[...] so that $f$ is continuous everywhere.".
A: My educated guess as to the specific question you are referring to in the text is

Problem 5.1.5 (Sp77):  1.  Evaluate $P_{n-1}(1)$, where $P_{n-1}(x)$ is the polynomial $$P_{n-1}(x) = \frac{x^n-1}{x-1}.$$  2.  Consider a circle of radius $1$, and let $Q_1, Q_2, \ldots, Q_n$ be the vertices of a regular $n$-gon inscribed in the circle.  Join $Q_1$ to $Q_2, Q_3, \ldots, Q_n$ by segments of a straight line.  You obtain $(n-1)$ segments of lengths $\lambda_2, \lambda_3, \ldots, \lambda_n$.  Show that $$\prod_{i=2}^n \lambda_i = n.$$

Here I have reproduced the entirety of the problem not for the sake of answering it, but to ensure that this is the same problem that you are referencing in your question.  My source is the second edition, and the pages on which this problem appears is 59-60.  The solution (in my text) appears on page 284 and is straightforward.

All that said, I would like to comment that this problem is written rather poorly; it is oddly and imprecisely posed in part 1.  But this is itself a sort of clue as to the intention of the problem's author, for the key here is the implication that $P$, being a polynomial (and whose subscript $P_{n-1}$ is an indication of its degree), must be continuous at $x = 1$, even if its definition leads to an indeterminate form at this value.  Thus by dividing it out and equivalently expressing $P_{n-1}$ as $$P_{n-1}(x) = \sum_{i=0}^{n-1} x^i,$$ and in fact we can trivially show that this sum, multiplied by $(x-1)$, yields the numerator $x^n-1$ identically for any $x$; we therefore sidestep the indeterminate value at $x = 1$.  Again, this is just a matter of my personal opinion, but I would find it slightly objectionable to pose the problem in such a way.  I would prefer to see some language explicitly asking for a limit, for example.
A: 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$.
A: Two major way to define a function from A to B, in both its just a part of AxB (Cartesian product), such that , ether:
1-for every x in A there only one y in B that (x,y) is member of the function .
you can say that f is from A to B, and give the expression of f(x) (that should be well defined in B for all x in A)
2-for every x in A there at most one y in B that (x,y) is member of the function .
you can say that f is from A to B, and give the expression of f(x) , then we should find the part of A where this is defined 
So based on your text: I guess that your function has IR (reels) as first set, witch contains 1. And some where that function is mentioned as continuous , then that expression of f(x) where x#1 so you can conclude that f(1)=n
A: I think it should be more like this:

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


$$f(x) = x^{n-1} + \cdots + 1 \to f(1) = n$$
However, for $x \neq 1$,
$$f(x) = (x^n-1)/(x-1)$$
$(*)$ I think $x \neq 1$ is for the second but not first equality above.
Well, you could see this as a piecewise function:
$$f(x) = ((x^n-1)/(x-1))1_{x \ne 1} + n1_{x=1}$$
