Is the codomain part of the function?

56 Views Asked by At

If functions are defined as sets of ordered pairs, then how does it make sense to talk about the codomain of a function, or talk about a function being surjective (rather than saying something like “surjective to $X$”)?

If the codomain is actually part of the function, then does that mean that if $f : \mathbb{N} \to \mathbb{N}$ and $g : \mathbb{N} \to \mathbb{Z}$ such that $f(n) = g(n) = n$, then $f \neq g$?