Let's consider the function:
$$ f(x) = \frac {x^2 + x - 6}{x - 2} $$
At x = 2, the value fo the function is undefined, because $ x - 2 $ = 0. But if factor the expression on the numerator, we get $ \frac {(x + 3) (x-2)}{x-2} $, which on simplifying yields $ x + 3 $. At $ x = 2 $, the function gives 5, which is not what we get before simplifying.
If all we do too the initial function is simple algebraic manipulation, shouldn't both functions yield the same value?
The simplification is only valid for $x\neq 2$, so you are not allowed to put $x=2$ into the resulting simplified expression. $f(2)$ is still not defined.
In other words, it is not true that “$f(x)=x+3$”. What is true is that “$f(x)=x+3$ provided that $x\neq 2$”.
It is critical to retain any provisos you implicitly introduce when simplifying. To fail to do this is sloppy and result in erroneous conclusions.