I have a simple question about functions and domains. Consider the following function: $$f(x) = \frac{ x^2-9}{x-3}$$
I often see in the textbooks mentioning that the domain of this function can be any real number except 3. However, the given function can be reduced to $$ f(x) = \frac{(x+3)(x-3)}{(x-3)} = x+3 $$
Here, the domain now becomes all real number. How this is possible? If both are the same function, how they can have two different domain?
Many thanks for helping a beginner. I appreciate your answers in advance.