TITLE: Different functions or same functions
QUESTION [5 upvotes]: I have a question in my booklet : 

$f(x) = \frac{x}{x}$ and $f(x) = 1$ are different or not why or why not?

I can only think that the functions are different because the second one is a constant function irrespective of the value of $x$. 
But on evaluating the first function we will always get $1$. and in the first function is undefined at $x = 0$ while the second function is defined at $x = 0$. 
Is there any other way of thinking it mathematically and my instructor never covered anything related to this. Kindly help.

REPLY [3 votes]: It depends on how you phrase the question. If you say

Let $f,g : \mathbb{Q}\setminus\{0\} \to \mathbb{Q}$, $$f(x) = \frac{x}{x}, \qquad g(x)=1$$

then $f$ and $g$ are in fact equal. This is also true if you replace the rational numbers $\mathbb{Q}$ with the reals, or with complex numbers... as long as you do it consistently for both functions.
However, because $g$ doesn't actually use its argument, there's no reason to assume its domain should be $\mathbb{Q}\setminus\{0\}$. I could write

Let $g : \{1, 2, (0,5), i,\mathrm{cucumber}\} \to \mathbb{R}$, $$g(x)=1$$

or, more reasonably, just

Let $g : \mathbb{Q} \to \mathbb{Q}$, $$g(x)=1.$$

Then, $g$ would be a completely different kind of object from $f$, and depending on your philosophy they would either be nonequal or it wouldn't even make sense to ask whether they're equal.