TITLE: $(\Bbb R \to \Bbb R : x\mapsto x^2)\equiv(\Bbb R \to \Bbb{R}_{\geq 0} : x \mapsto x^2) \not\equiv (\Bbb C \to \Bbb C:x\mapsto x^2)$
QUESTION [8 upvotes]: Consider the following functions:
$f:\Bbb R \to \Bbb R  : x\mapsto x^2$
$g:\Bbb R \to \Bbb{R}_{\geq 0} : x \mapsto x^2$
$h:\Bbb C \to \Bbb C:x\mapsto x^2$
I'm quite sure that $h$ is not equal to $f$ or $g$, but I'm not sure if $f$ and $g$ are equal or inequal.
If you see $f$ and $g$ as subsets of $\Bbb R \times \Bbb R$, then I think both are equal. However, the codomain of $f$ is not the same as the codomain of $g$, therefor you could argue, $f$ and $g$ are not equal. If we would agree that $f=g$, I would not see the point of specifying the codomain.
At university I learned this definition from "Reading, Writing, and Proving: A Closer Look at Mathematics":

A function $f:X\to Y$ is a relation $f$ from $X$ to $Y$ satisfying:
  i). $\forall x\in X ,\exists y\in Y :(x,y)\in f $
  ii). $\forall x\in X,\forall y_1,y_2 \in Y : (x,y_1),(x,y_2)\in f\implies y_1=y_2$
An function is often called an map or a mapping. The set is $X$ is
  called the domain and denoted by $\text{dom}(f)$, and the set $Y$ is
  called the codomain and denoted by $\text{cod}(f)$. When we know what
  these two sets are and the two conditions are satisfied, we say that
  $f$ is a well defined function.

From this definition I would conclude that $f\not=g$. Is this correct ? Are there definitions in mathematics where $f=g$? Can somebody enlighten me a little bit here ?

REPLY [3 votes]: As I understand it, in some areas of mathematics, they may talk about "the curve $y=x^2$, and then sometimes talk about "real points on the curve" or "complex points on the curve" and so on.  In that case, I guess the curve itself is not a set of ordered pairs in the sense of your textbook.