What makes a function not defined?
Consider the following functions: $$f(x) = 5$$
$$g(x) = \dfrac{5(x-2)}{(x-2)}$$
The function $g$ is not defined at $x = 2$, but agrees with $f$ at every other point.
So we would say these functions are not the same, because their domains are different.