Perhaps this is a silly question, but if you have a function, such as
$$f(x) = \frac{x^2}{x}$$
the domain is all real numbers except x = 0.
However, this function simplifies to
$$f(x) = x$$
which has a domain of all real numbers. The domains for the two functions are different. Why are you permitted to simplify the first function if the domain changes?