Function and Domain with Deleted Neighbour - Beginner Question 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.
 A: The confusion may be, that in your case, when you have $ f(x) = \frac{(x+3)(x-3)}{(x-3)} = x+3 $, and you divide with $(x-3)$, you need to suppose, that $x \ne 3$, because then it would lead to divising with $0$. In that case, the Domain is still all real numbers except $3$.
A: A function is a triple $(A,B,f)$ where $A$ is domain, B is codomain and $f$ is a rule that for each element of A correspond only one element in B. Two functions $(A,B,f)$ and $(C,D,g)$ are equal if only if
$$A=C, B=D, f(x)=g(x) \forall x \in A=C$$
In your question $f(x)=\frac{x^2-9}{x-3}$ has domain $A=\mathbb{R}\setminus\left\{3\right\}$ while the function $g(x)=x+3$ has domain $C=\mathbb{R}$ and may not be equal.
A: This is a good question. They are not the same function.
Let us define two functions, $$f(x)=\frac{x^{2}-9}{x-3} \quad \text{and} \quad g(x)=x+3$$
Then, for every $x \ne 3$, $f(x)=g(x)$. If $x=3$, $f(x)$ is undefined, but $g(3)=6$ unambiguously.  
If, instead, we define $f(3)$ to be $6$, then $f$ is a continuous function, which is nice. But, as defined, $f$ is not defined at $3$.
