$\frac{(x-1)(x+1)}{ (x+1)} \rightarrow (x-1)$ Domain Change Forgive my ignorance. The below seems 'inconsistent'. If canceling the $(x+1)$ is 'legal', how does the domain change? I realize it does, but would someone be so kind as to provide an explanation?

$$ \frac{x^2 - 1}{x + 1} \mbox{ is undefined when } x = -1 $$
Its domain (the values that can go into the expression) does not include $ -1 $.
Now, we can factor $ x^2 - 1 $ into $ (x - 1)(x + 1) $ so we get:
$$ \frac{(x - 1)(x + 1)}{(x + 1)} $$
It is now tempting to cancel $ (x + 1) $ from top and bottom to produce:
$$ x - 1 $$
$$ \mbox{Its domain now } \textbf{does} \mbox{ include } -1 \mbox{.} $$
But it is now a different function because it has a different domain.

Thanks!
 A: The function $f$ given by
$$
f(x):=\frac{(x-1)(x+1)}{x+1}
$$
with values in $\mathbb{R}$ can't be defined at $x:=-1$ (because the denominator will be $0$). Hence the domain of $f$ is at most $\mathbb{R}\backslash\{-1\}$.
The function $g$ given by
$$
g(x):=x-1
$$
with values in $\mathbb{R}$ is defined for every $x\in\mathbb{R}$, so its domain is $\mathbb{R}$.
Thus, as functions, $f\neq g$ because their domains are not the same.
Perhaps your confusion comes from the fact that
$$
\lim_{x\to-1}f(x)=\lim_{x\to-1}\frac{(x-1)(x+1)}{x+1}=\lim_{x\to-1}(x-1)=\lim_{x\to-1}g(x)
$$
But this is true because the limit of a function as $x\to-1$ is completely independent of the value of the function at $-1$ and $f(x)=g(x)$ for every $x\in\mathbb{R}\backslash\{-1\}$.
A: Simply put, the first equation's domain does not include $-1$, while the second equation does.
A: Consider the three different functions.
The first function is the function that you original function.
$$f:\mathbb{R} \setminus\{ -1\} \rightarrow \mathbb{R}$$
$$f(x)=\frac{(x-1)(x+1)}{x+1}$$
The second function is as follows.
$$g:\mathbb{R} \setminus\{ -1\} \rightarrow \mathbb{R}$$
$$g(x)=x-1$$
It is actually the same function as $f$. It is alright to cancel the common terms from both numerator and denominator., as long as you know what you are doing and keeping track of your domain.
Now the third function is not exactly the same function as $f$ but it is very close, with an extra point in the domain.
$$h:\mathbb{R} \rightarrow \mathbb{R}$$
$$h(x)=x-1$$
I think the book isn't very clear as it does not state the domain of the functions explicitly and just look at the formula and take the largest possible subset of real numbers. 
You are right that in cancelling out common terms, the domain shouldn't change.
A: A function is not just an expression. It is a special assignment (a formula, a table, a diagram, etc) together with a chosen domain and a chosen codomain. The choices must make sense however. If the domain is the same, the codomain is the same and $f(x)$ and $g(x)$ coincide for every member $x$ of the domain, only then do we say the functions are equal.
For example, let $f(x) = \dfrac{x^2-1}{x+1}$ and $g(x) = x-1$.
and let's choose the domain for both to be the set $\{1,2,3,4,...\}$ and lets choose the codomain to be the range (which is $\{0,1,2,...\}$).
In this case, $f$ and $g$ are the same function. For every member $N$ of the domain, $f(N)$ is equal to $g(N)$.
If we choose the domain instead to be $\mathbb R$ then we run into a problem. $g$ is happy with $-1$ which now belongs to the domain, it hands you back $g(-1)=-2$. but $f(-1)$ doesn't make sense, so the domain we chose for $f$ doesn't even work. We're broken from the get-go. They can't be the same if the function $f$ can't even exist.
Now if we choose the domain for both of them to be everything except for $-1$, sometimes written $\mathbb R \setminus \{-1\}$, and to have codomain $\mathbb R$, then $f$ and $g$ are again the same function.
A: The expression
$$\frac{x-1}{2x-2}$$
is an algebraic fraction, that is, a quotient of polynomials (just like the usual fractions are quotients of integers).
As an algebraic fraction, the expression above is equivalent to $1/2$. That means that the equality
$$\frac{x-1}{2x-2}=\frac12$$
is true because $(x-1)\cdot 2=(2x-2)\cdot 1$. This does not depend on the value you assign to $x$. In fact, this does not depend on if you assign a value to $x$ at all.
But since the basic properties of addition and product for polynomials and numbers are the same, it's true that if the algebraic fractions
$$\frac{P(x)}{Q(x)},\frac{R(x)}{S(x)}$$
are equivalent, then for most numbers $a$ the equality between numbers
$$\frac{P(a)}{Q(a)}=\frac{R(a)}{S(a)}$$
holds.
But the equality fails if some of the denominators $Q(a)$ or $S(a)$ is zero. Not only fails to be true. It fails to make sense.
In other words, the equality between algebraic fractions
$$\frac{x-1}{2x-2}=\frac12$$
implies that the equality between numbers
$$\frac{a-1}{2a-2}=\frac12$$
holds for every number $a$ different from 1.
A: 
The below seems 'inconsistent'. If canceling the $(x+1)$
   is 'legal', how does the domain change?

You are correct; it is inconsistent.  The source you are quoting is badly written (or badly explained).
The mathematical fact is that a function may have any arbitrary domain.
However, if the function is mathematically undefined for certain inputs, then the domain must implicitly exclude those inputs.  Thus the domain of $$f(x)=1/x$$ implicitly excludes $x=0$ from the domain.

Strictly speaking, a function definition is not complete without an explicit expression of the domain.
In school textbooks, however, the domain (and range) is usually implicitly assumed to include all types of numbers the student has learned so far (and no others), unless stated otherwise.  For example, in a first grade textbook, $$3-7=?$$ is assumed not to have any solution, because the implied domain* (and range) for all arithmetic as of first grade is "positive integers."  Likewise $$13/7=?$$ implicitly has no solution in a first grade textbook.  Perhaps a more interesting example is that in a 9th grade textbook, $$x^2+9=0$$ implicitly has no solution.

The point is that there is no reason to assume a domain of $\mathbb{R}$ for the function: $$\frac {x^2-1} {x+1}$$  Why should complex numbers be excluded?  Unless the domain is actually defined explicitly, it is just an assumption that goes along with whatever level of math textbook you are studying.
So the domain is only implicit—and the point is that canceling the $x+1$ while leaving the domain implicit results in a function with a different domain, which is therefore a different function.
However, it is perfectly legal and consistent to cancel out the $x+1$ while retaining the same domain.  It simply must be stated explicitly rather than implicitly.

*I am here using the words "domain" and "range" loosely, as a first grade mathbook generally doesn't include anything that could be strictly called a "function."
A: First of all, it is very important that you know that a function is not just an expression (in fact, a function need not to have an expression). A function is "composed" or "defined" (and this is not the formal definition of function) of three parts: two sets and a "rule". The two sets are called domain and range and the "rule"  is supposed to be an association which assigns to every element of the domain one, and only one, element of the range. What I am trying to say is that expressions such $x^2, x-1$ and many others are not functions, for they have no domain. Now, what is usually asked in exercises is for us to determine the "greatest" set which can be the domain for a given expression, ie, the set of all values for which it is plausible to calculate the value of the expression substituting $x$ by such value. However, when we write "the function $x^2$", we are usually considering the function whose rule is $x^2$ (ie, a that assigns a certain number to its square) and whose domain is the greatest possible (in this case, $\mathbb{R}$). 
Now let me get to what you actually asked. No, the domain does not change. When your book, writes "the function $\frac{(x-1)(x+1)}{x+1}$", it is considering the function whose expression is $\frac{(x-1)(x+1)}{x+1}$ and whose domain is the greatest possible, which in this case is $\mathbb{R}\backslash \{-1\}$. Now taking a look at this expression, when $x$ is not equal to $-1$, there is no problem in cancelling out $x+1$, so it happens that the value of the function equals $x-1$, when for x different than $-1$. So it happens that your function equals the function whose expression is $x-1$ in $\mathbb{R} \backslash \{-1\}$ because they have the same domain and their value is equal at every point of their domain.
A: This conundrum is a common issue students encounter when working with functions and domain for the first time. It's a symptom of the fact that we don't properly define what a function is from the start:
A function in mathematics is a relation, $f$, between a set, $X$, called the domain, and a set $Y$ called the codomain, such that each element of the domain ($\forall x \in X$), is related to exactly one corresponding element of the codomain $f(x)=y\in Y$.
(A relation, $R$ is merely a subset of the Cartesian product of a domain with a codomain $R\subseteq X\times Y$, which we view as an association between (some) elements of the domain, $X$, and (some) elements of codomain, $Y$. An $x\in X$ may be associated to more than one $y$ or none at all, likewise, for a given $y\in Y$, it may be associated to one or more $x$'s or none at all).
As a sidenote: If you've ever wondered what $f$ itself is, it's actually the set of ordered pairs, $(x,y)$ that specify the associations between each domain element and it's unique corresponding codomain element. The expression $f(x)$ actually denotes what's known as the image under $f$ of the domain element $x$ (i.e. the corresponding $y$ in the codomain).
This proper definition and attendant concepts are glossed over, or avoided entirely when functions are first introduced, and that pedagogical mistake (imo) comes home to roost when they are then asked about domain (and range, not to be confused with codomain; they are related but not the same thing).
Worse yet, in familiar contexts, there is a usually unmentioned convention for denoting functions that is taken. Since one is often interested in functions between the real numbers and itself, or between a subset of the real numbers and the real numbers, and these sets are (usually) all infinite. There exists a bit of a problem in how exactly we hope to capture exactly where each and every domain element is mapped to in the codomain? This is usually handled by the use of a rule of assignment which specifies how we can obtain the unique codomain element $f(x)$ specified by a given choice of a domain element $x$. Familiar examples such as $f(x)=x+3$ and $f(x)=x^2$ and many more are examples of such rules of assignment. These familiar examples use arithmetic operations and (later) other well understood functions to specify the corresponding codomain element for every possible domain element. Some of our arithmetic rules are not defined everywhere in the reals though, for instance one cannot divide by $0$, or take a square root of a negative number (and remain in the reals, at least) etc. Because of this, rules like $1/x$ do not make sense over all of $\mathbb{R}$, thus the convention is that the domain for functions specified by a rule of assignment is the largest possible subset of the reals for which that rule makes sense (or in more formal language: for which that rule is definable). Hence the task that is actually being asked of beginning algebra students is to deduce the largest subset of the reals for which a given arithmetic expression (that is the given function's rule of assignment) actually makes sense. That is the conventionally defined domain of that function.
