Algebra on function can change behavior? Rookie question, but I am confused here :)
So, lets say we have the following function:
$$f(x) = \frac{x-1}{x^2 -1}$$
It also equals to:
$$g(x) = \frac{1}{ x + 1}$$
$g(x)$ is defined at $x=1$ but $f(x)$ isn't. In a similar way, we could make any function undefined at any point $p$, at a $x$-coordinate we desire simply by multiplying the function by $\frac{p - x}{ p -x}$.
What am I missing here?
 A: It comes down to understanding how functions are defined. A function $f$ is a subset of a Cartesian product of two sets $A$ and $B$, satisfying certain properties. That is, $f$ is a set of ordered pairs in the form $(a, b)$, where $a \in A$ and $b \in B$. It must additionally satisfy the following two properties:


*

*For all $a \in A$, there exists a $b \in B$ such that $(a, b) \in f$,

*If $(a, b_1), (a, b_2) \in f$, then $b_1 = b_2$.


The first condition states that every element $a \in A$ must occur in at least one ordered pair $(a, b) \in f$, and the second condition states that every element $a \in A$ must occur in at most one ordered pair $(a, b) \in f$. So, in total, every element $a \in A$ must occur in exactly one ordered pair $(a, b) \in f$. This means, for every element of $a \in A$, there is a unique associated $b \in B$, and we denote this $b$ by $f(a)$.
We call the set $A$ the domain of $f$, and $B$ the codomain of $f$. As coffeemath points out, it's important to specify the domain and codomain. Technically speaking, the rule $x \mapsto \frac{x^2 - 1}{x - 1}$ does not define a function from $\Bbb{R}$ to $\Bbb{R}$, as it fails to associate some $b \in \Bbb{R}$ to $a = 1$, in violation of the first property.
Instead, this rule can be naturally turned into a function on $\Bbb{R} \setminus \{1\}$. This is the largest subset of $\Bbb{R}$ on which this rule defines a function. This is what is often called the "natural domain". If you consider a rule like $x \mapsto \frac{x^2 - 1}{x - 1}$ to be a function, the domain is typically taken to be the natural domain, which is (again) $\Bbb{R} \setminus \{1\}$.
Compare this to the rule $x \mapsto x + 1$. This is defined for every $x \in \Bbb{R}$, so its natural domain is $\Bbb{R}$. Without specifying domains, and simply defining
\begin{align*}
f(x) &= \frac{x^2 - 1}{x - 1} \\
g(x) &= x + 1,
\end{align*}
then, by convention, you are defining $f$ and $g$ as functions on their respective natural domains (to the codomain $\Bbb{R}$). This means $f$ and $g$ are not the same! As sets, we have $(1, 2) \in g$ (as $g(1) = 2$), but $(1, 2) \notin f$.
In fact, simply knowing that $1$ lies in the domain of $g$, but not in $f$, is enough to know that these functions are not equal. From the first condition, we know that $(1, b) \in g$ for some $b$, but since $f$ is a subset of its domain multiplied to its codomain, and $1$ does not lie in its domain, then there is no element of the form $(1, b)$ in $f$. Thus, necessarily, $f \neq g$.
A: We can say that
$$\left(f(x) = \frac{x - 1}{x^2 - 1}\right) \land (x \neq 1)$$
$$\Leftrightarrow g(x) = \frac{1}{x - 1}.$$
A: $f(x)=\frac{x-1}{x^2-1}$ is a function that is (naturally) defined for all real $x \neq 1,-1$.
If we assume $x \neq 1$ then $x-1 \neq 0$ and we can divide both parts of the fraction by $x-1$ and get $f(x)=\frac{1}{x+1}$ for all $x \neq 1$ and this formula is not defined for $x=-1$, just as the previous one wasn't. But in this formula we can substitute $x=1$ to get $f(1)=\frac{1}{2}$. So what is the case is that $$\lim_{x \to 1} \frac{x-1}{x^2-1} = \frac12$$
so the original function has a "hole" in its graph at $(1,\frac12)$ which can be filled (continuous extension) so that its domain has one point more. This is a removable discontinuity in $\frac{x-1}{x^2-1}$. It agrees with $\frac{1}{x+1}$ for all of $\Bbb R\setminus \{1\}$. Usually we simplify such functions and divide out common factors, but you have to keep in mind that the original function wasn't defined at that point. 
This helps limits and integrals, but for equations like $f(x)=h(x)$ you have to remember to check any found $x$ in the original unsimplified equations, to check that we don't introduce "fake" solutions on the way.
A: Yes you will make any expression undefined at $p$ by multiplying by $\dfrac{p-x}{p-x}$. This way you define a different function, as the domain is part of the definition.
You might as well multiply by $\dfrac{\log x}{\log x}$ or even $\dfrac{\sqrt{-x^2}}{\sqrt{-x^2}}$.
A: Let consider the simpler
$$f(x)=\frac x x $$
which is equal to $1$ for any  $x\in\mathbb R\setminus\{0\}$ since $x/x$ is not defined.
The point $x=0$ is a so called removable discontinuity point since we can obtain a continuous function by defining $f(0)=1$.
