Are two mathematically alike functions equal?

Solution 1:

Yes, the functions are equal. The choice of $x$ or $y$ (or any other symbol) doesn't carry any meaning; those are what are sometimes referred to as dummy variables (link to MathWorld). I could define $h:\mathbb{R}\to\mathbb{R}$ by $$h(\&)=\& ^2$$ and then $h$ would again be the same function as $f$ and $g$.


More generally, if $A$ and $B$ are sets, then a function from $A$ to $B$ is usually defined formally to be a subset $R\subseteq A\times B$ such that, for all $a\in A$, there is exactly one element of $R$ whose first entry is $a$. The collection of all functions from $A$ to $B$ is usually written $B^A$. Under this system, $f$ refers to the subset $$\{(x,x^2):x\in\mathbb{R}\}\subset \mathbb{R}\times\mathbb{R}$$ and $g$ refers to the subset $$\{(y,y^2):y\in\mathbb{R}\}\subset \mathbb{R}\times\mathbb{R}$$ But the subsets are the same, since they have the same elements! $\,(3,9)$, $\,(-1.1,1.21)$, $\,(\pi,\pi^2)$, etc., all the elements of one are elements of the other and vice versa. By the axiom of extensionality (Wikipedia) they are equal. This more formal argument is what Andrea Mori's answer is about.

Solution 2:

A function $f:\Bbb R\rightarrow\Bbb R$ can be seen as a (certain) subset of $\Bbb R^2$ (Note: in fact the functions are usually defined to be certain subsets, but you can ignore this now)

Two functions are the same when the corresponding subsets are the same. The names you choose for the coordinates in $f:\Bbb R\rightarrow\Bbb R$ are irrelevant.

Solution 3:

In elementary schools these days students might see the function described this way $$ f(\quad) = (\quad)^2 $$ or $$ f(\text{weird symbol}) = (\text{weird symbol})^2 $$ so when they get as far as you they wouldn't have to ask this good question.

Solution 4:

Are you a different person whether I refer to you as "Ethan Zell" or as "the person who asked the question"? You surely aren't. That's because both are only names given to you; they are not you. Similarly, in $f(x)$ and $g(y)$, $x$ resp. $y$ is the name that is given to the function's argument, and thus it doesn't matter what it is.

Well, OK, it almost doesn't matter. Should you decide to call your argument $1$, then you'd run into trouble, because for example the name $1$ is, by convention, reserved for the number one, or some constant that closely resembles that number in whatever topic you are working. This is similar how it would be wrong to call you "the president of the United States" (unless you actually happen to be the president of the United States, of course), because that is also a name that is reserved for a specific meaning, namely the president of the United States.