Why is it ok to factor an equation with no limit so it has a limit? I'm just starting out in calculus, so please bear with me if this is not a sensible question.
In the book I'm reading, the author gives the example of the problem of finding the limit of $\lim\limits_{x\to 5}(\frac{x^2 - 25}{x-5})$, because if you substitute in $x=5$, you get a denominator of $0$, so the output of the function at $x=5$ is undefined.
He then goes on to demonstrate how by factoring this equation to $\lim\limits_{x\to 5}(x+5)$, you can now plug in $x=5$ to get $\lim\limits_{x\to 5}(x+5) = 10$.
But is not the fact that 'at $x=5$ the function is undefined' an integral part of the original function? By factoring it, have you not added to the domain of the original function and therefore created a different function? So now you have the limit of a different function? 
 A: Consider $\displaystyle f(x)=\frac{x^2-25}{x-5}$ and $g(x)=x+5$.
If $x\neq 5$ then $f(x)=g(x)$, so for all $x$, except for $x=5$, the graphs of $f(x)$ and $g(x)$ are identical.
At $x=5$, $f(x)$ is undefined but $g(5)=10$.
Therefore the graph of $f(x)$ is the same as $g(x)$ except that it has a hole at $x=5$.
If you draw this picture it is clear why the limits are the same.
+1 for asking the question --- it is one that students often don't ask about unless the instructor actually shows that functions that are equal at all points - except perhaps at a single point - have equal limits.
A: Functions are not necessarily equal to their limits. Yes, the function is undefined, but the limit is in fact 10. You can actually pretty easily prove this is the case straight from the definition of a limit.
In general, you're thinking about continuous functions. It is equivalent to the definition of a continuous function (or, depending on the text, is the definition of a continuous function), for the function to be equal to it's limit. However, it's easy to see that this function is not continuous at x=5, given that the function isn't defined there, as you note.
A: It's easy to formalize what they're doing. They're saying, where $f(x)=\frac{x^2-25}{x-5}$ and $g(x)=x+5$:

There is a punctured neighborhood around $5$ (i.e. a set of $x\neq 5$ with $|x-5|<\varepsilon$) such that $f(x)=g(x)$. Therefore
  $$\lim_{x\rightarrow 5}f(x)=\lim_{x\rightarrow 5}g(x).$$
  However, $g(x)$ is continuous, therefore
  $$\lim_{x\rightarrow 5}g(x)=g(5).$$

So, there are actually two little steps here - firstly is making the simplification, which only relies on $f$ and $g$ coinciding near $5$. Secondly is plugging in the value to get the limit, which relies on $g$ being continuous. So, yes, though $f$ was not defined at $5$, it doesn't matter, because we'd already switched out $f$ for $g$ by that point.
A: You are correct to note that there is something strange going on since you should be told never to divide top and bottom by zero since it can give pathological statements.  If we divide by $(x-5)$ from the top and bottom while $x=5$, then yes, that is indeed a problem.
The argument however is that we are not actually dividing by zero ever, and are interested in dividing $(x+\epsilon-5)$ from top and bottom, where $\epsilon\neq 0$ and are interested in what happens as $\epsilon$ becomes arbitrarily small (but still nonzero).
Since we are allowed to divide top and bottom by nonzero numbers, there is no contradiction, and the limit becomes $\lim\limits_{x+\epsilon\to 5}(x+\epsilon+5)$, which if $\epsilon$ is sufficiently small is by definition equal to $10$.
A: First, I will show you the solution to your problem:
$$\lim_{x\to5}\frac{x^2-25}{x-5}=$$
$$\lim_{x\to5}\frac{(x-5)(x+5)}{x-5}=$$
$$\lim_{x\to5}x+5=5+5=\boxed{10}.$$
To answer you question in short, you are simplifying the continuous function. So essentially, $\frac{x^2-25}{x-5}$ is equivalent to $x+5$ by means of factoring to make the function unchanged. Just simplified.

We can also prove this limit bye performing a delta-epsilon proof:
Proof. Let $\epsilon>0$. Choose $\delta=\epsilon$. If $0<|x-5|<\delta$, then 
$$\left|\frac{x^2-25}{x-5}-10\right|=\left|\frac{(x+5)(x-5)}{(x-5)}-10\right|=|x+5-10|=|x-5|<\delta=\epsilon.$$
Thus, we have $\left|\frac{x^2-25}{x-5}-10\right|<\epsilon. \ \ \ \ \ \ \ \blacksquare$
