$(\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)$ 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 ? 
 A: If you define a function as a set of ordered pairs with a certain property, then $f$ and $g$ are equal. They both have the same ordered pairs.
If you define a function as a triplet of domain, codomain and a graph (which is the set of ordered pairs from the first definition, in many cases), then $f$ and $g$ are not equal because they have different codomains.
In either case, $h$ is different because it has a different domain and different ordered pairs (e.g. the pair $(i,-1)$ is not in $f$ or $g$, or in their graphs as per the second definition).
The former definition is very useful in set theory, the latter is very useful in category theory. Generally, it doesn't really matter for the mathematics as long as you understand the fine point of differences and how to go from one form to another when you do need to.
Also interesting: Definition of Function (MathOverflow).
A: 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.
A: I would say that indeed $f \equiv g$ in this situation, because since $\mathbb{R} \times \mathbb{R}_{\ge0} \subset \mathbb{R} \times \mathbb{R}$, then $g\in\mathbb{R} \times \mathbb{R}_{\ge0}$ also means that $g\in\mathbb{R} \times \mathbb{R}$
