A quick and easy question on terminology:
If we have a function $$f(x) = \frac{x(x-2)}{(x-2)}$$ then clearly the function is not defined at $x = 2$.
If we cancel out "$(x-2)$" then the function is defined everywhere (it is just the identity function).
Does the definition of function not require that we consider these to be two different functions?
NOTE: The concept of "removable discontinuities" in elementary calculus is a weird one. The function $f$ is not really discontinuous over its domain. This is because $2$ is not really in its domain.
The function $f$ as you've defined it has the signature $f: \Bbb R \setminus \{2\} \to \Bbb R$. This means that the function $f$ is defined everywhere in the real numbers $\Bbb R$ except at $2$. If this signature (or just the domain) is specified first, then we could just as well define the mapping $f$ by $f(x) = x$. Because $x=\dfrac {x(x-2)}{x-2}$ for all values $x\ne 2$.
All you are doing when you "cancel out" the $(x-2)$'s is defining a new function $f_{new}$ which is an extension of $f$ to the topological closure of its domain. Basically the topological closure of a set $X$ has every element of the set $X$ AND every limit point of the set $X$. In this case $2$ is a limit point of the set $\Bbb R \setminus \{2\}$, so the closure of the set $\Bbb R \setminus \{2\}$ is just the set $\Bbb R$. Then the way we define the value of $f_{new}(2)$ is by making the function continuous at that point (not always doable, but in this case it is). So $f_{new}(2) = \lim_{x\to 2} f(x) = 2$.
So this function $f_{new}$ takes the same value as $f$ at every point in the domain of $f$ and additionally takes the value $2$ at $x=2$. So in this case, $f_{new}$ has the signature $f_{new}: \Bbb R \to \Bbb R$ and is defined by $f_{new}(x)=x$. Are $f$ and $f_{new}$ the same function, then, if they can both be defined by $f(x)=x$? No. They are different because they have different signatures: $f$ is NOT defined at $x=2$, but $f_{new}$ is.