Understanding of Equality of Functions Let $f$ and $g$ be two functions such that $f:\mathbb{R} \rightarrow \mathbb{R}$, $g:\mathbb{R} \rightarrow \mathbb{R} ^{\geq 0}$ and $f\left( x\right) =g\left( x\right) =x^{2}$.
My question is $f=g$ ? I think, yes. 
Recall that Let $f,g$ be two functions such that $f:X \rightarrow Y$ and $g:X' \rightarrow Y'$. If $f=g$ then $X=X'$ and $Y=Y'$ finally for all $x\in X$, $f\left( x\right) =g\left( x\right)$.
 A: That depends on how you interpret the object "function". There are two common ways to do so, and they give you different answers. Both methods have their upsides and downsides.

*

*The set theoretic approach takes a function to be just a set of ordered pairs. In this case $f\colon A\to B$ means that $f$ is a subset of $A\times B$ such that for every $a\in A$, there exists a unique $b\in B$ for which $\langle a,b\rangle\in f$.
In this approach, we can always enlarge $B$, and the function remains the same. So $f$ and $g$ are indeed equal. This option makes it easier to talk about compatible functions, taking their limits, and in the case of talking about proper class of functions, sometimes it is easier not to worry about codomains.


*The categorical approach takes a function to be an ordered triplet: $\langle A,B,f\rangle$ where $A$ is the domain of $f$, $B$ is the codomain of $f$, and $f$ satisfies the set theoretic definition for $f\colon A\to B$. In this approach changing the codomain changes the function.
But in this approach being a surjective function is an intrinsic property of the function, and not an external property.
So the question whether or not $f$ and $g$ are equal depends on what is a function for you.
