Question: I understand that division by zero isn't allowed, but we merely just multiplied $f(x) = 1$ by $\frac{x-1}{x-1}$ to get $f(x) = \frac{x-1}{x-1}$ and $a\cdot 1 = 1\cdot a = a$ so they're the **same function** but with **different domain** how is this possible?

*Or in other words* why don't we simplify $f(x) = \frac{x-1}{x-1}$ to $f(x) = 1$ before plotting the points.
Is it just defined this way or is there a particular reason ?

**Note:** my book says the domain of $f(x) = 1$ is $\mathbb{R}$ and the domain of 
$f(x) = \frac{x-1}{x-1}$ is $\mathbb{R}$ except $1$.

Answer: 
They are the same *almost everywhere*. But clearly one of them does not exist for $x=1$ (since "$\tfrac{0}{0}$" is undefined), while the other one is simply $1$ at $x=1$.

> 
> I understand that division by zero isn't allowed, but we merely just multiplied f(x) = 1 by (x-1)/(x-1)
> 
> 
> 

You can multiply by any fraction $\tfrac{a}{a}$; but not when $a=0$ because the fraction you want to multiply with, isn't even defined then. So multiplying by $\tfrac{x-1}{x-1}$ is fine, but only valid for $x \ne 1$.

> 
> why don't we simplify f(x) = (x-1)/(x-1) to f(x) = 1 before plotting the points.
>  Is it just defined this way or is there a particular reason ?
> 
> 
> 

You can simplify, but recall that simplifying is actually dividing numerator and denominator by the same number: you can simplify $\tfrac{ka}{kb}$ to $\tfrac{a}{b}$ by dividing by $k$. But also then: this only works for $k \ne 0$ since you can't divide by $0$. So "simplifying" $\tfrac{x-1}{x-1}$ to $1$ is fine, for $x-1 \ne 0$ so for $x \ne 1$.

---

> 
> **Note:** my book says the domain of $f(x) = 1$ is $\mathbb{R}$ and the domain of 
>  $f(x) = \frac{x-1}{x-1}$ is $\mathbb{R}$ except $1$.
> 
> 
> 

Technically, the domain is a part of the function: it should be given (as well as the codomain). It is very common though that when unspecified, in the context of real-valued functions of a real variable, we assume the 'maximal domain' is intended (and $\mathbb{R}$ is taken as codomain). Then look at:
$$f : \mathbb{R} \to \mathbb{R} : x \mapsto f(x) = 1$$
and
$$g : \mathbb{R} \setminus \left\{ 1 \right\} \to \mathbb{R} : x \mapsto g(x) = \frac{x-1}{x-1}$$
The functions $f$ and $g$ are different, but $f(x) = g(x)=1$ for all $x$ except when $x=1$, where $g$ is undefined.
$f(x)=(x-1)/(x-1)$ does not have a value when $x=1$, different thing happens to $f(x)=1$