Cancelling common factors and equality of functions Suppose we have two expressions:
$\frac{x-1}{x-1}$ and $1$. In the first expression we cancel the nominator and the denominator and are left with $\frac{1}{1} = 1$ and the first two expressions are said to be equal. Now let us define two functions with these two expressions:
$f(x) = \frac{x-1}{x-1}$ and $g(x) = 1$.
The first function is not defined at 1 because we can't divide by zero and its domain is R not including 1. It is still said that we can cancel the nominator and the denominator in the function and get $f(x) = 1 = g(x)$ thus obtaining a function that is equal to $g(x)$. How is this possible when for two functions to be equal their domains must be equal? How can we use them interchangeably when they are two different functions? 
 A: As algebraic fractions,
$$\frac{x-1}{x-1}=\frac11$$
since $1(x-1)=(x-1)1$.
Furthermore, both expressions gives the same result for any real $x\neq 1$. Nevertheless, if you write $f(x)=\frac{x-1}{x-1}$ what must be understood is
$$f(x)=1,\quad x\in\Bbb R-\{1\}$$
The function
$$g(x)=1,\quad x\in\Bbb R$$
is not the same function as $f$.
A: The functions are definitely not equal because the function $f(x)=g(x)$ only if their domains are equal which is not the case here.Simply, because they don't have same domains they are not equal.
Therefore, it means whoever told you that these functions are inter-changeable is wrong.So your argument gets resolved as they are not inter-changeable.
A: Yes, you're right, these two functions are not the same. However, $g$ is an extension of $f$, or alternatively $f$ is a restriction of $g$:$$f=g|_{\mathbb{R}\setminus\{1\}}.$$
A: You got several things confused.


*

*You state
$$f(x)=g(x)$$and prove this by$$f(x)=\frac{x-1}{x-1}\stackrel{!}{=}1=g(x)$$
But in order for that to be a correct statement you must say for which $x$ this should hold true. Since you divide by $x-1$, it may not be zero, which bounds you to $x\in\mathbb{R}\setminus\{1\}$ as a “domain” in which your proof holds.



Now let us define two functions with these two expressions:



*

*You didn't do that correctly. To define a function using an expression, you still have to define the domain explicitly: Although the expression might restrict the domain you can choose, it does not enforce one. For instance, $$f_1:\mathbb{R}\setminus\{1\}\rightarrow\mathbb{R}, x\mapsto f(x)\\ f_2:\mathbb{R^–}\rightarrow\mathbb{R}, x\mapsto f(x)$$ are both valid functions based on the construction rule $x\mapsto f(x)=\frac{x-1}{x-1}$.
The definition you referred to should've been $$f:\mathbb{R}\setminus\{1\}\rightarrow\mathbb{R}, x\mapsto f(x)\\ g:\mathbb{R}\rightarrow\mathbb{R}, x\mapsto g(x)$$



It is still said that we can cancel the nominator and the denominator in the function and get $f(x)=1=g(x)$ thus obtaining a function that is equal to $g(x)$.



*

*This is also affected by the first point. But apart from that, because the domain had to be defined explicitly, it does not matter if you replaced $f(x)$ in the definition of $f$ by $g(x)$, because these give you the same value for every x under that it is evaluated — which is $\mathbb{R}\setminus\{1\}$

