Are 2 functions equal when they have same domain, same codomain and same law ?
EXAMPLE 1
$f: \mathbb{R} \to \mathbb{R}$
$x \to x^2$
and
$g: \mathbb{R} \to \mathbb{R^+_0}$ (set of positive reals with zero)
$x \to x^2$
are equal ?
EXAMPLE 2
$f: \mathbb{R} \to \mathbb{R}$
$x \to x^2$
and
$g: \mathbb{R^+_0} \to \mathbb{R}$
$x \to x^2$
are equal ?
Functions are sets of cartesian products that fulfill certain conditions, so for example a function $\;f:A\to B\;$ is a subset $\;f\subset A\times B\;$ which must fulfill the condition that $\;(a,b),\,(a,b')\in f\implies b=b'\;$.
Thus, two function are equal if, when thinking of them as sets, they are equal as such, and this means they both are subsets of the same cartesian product $\;A\times B\;$ , which thus means they have exactly the same domain, and also
$$(a,b)\in f\iff (a,b)\in g$$
which means that pointwise they're identical, and in usual functionwise notation::
$$\;\forall\,a\in A\;,\;\;f(a)=g(a)\;$$