When I was a university student, I learnt that a function is the data of three informations:
- the rule that tells how to associate an object $x$ to its image $f(x)$,
- A domain $E$ where live the values of $x$ that are transformed by $f$,
- and a codomain $F$, a space where all images can lives.
So, an usual notation for an function is $ f:\begin{array}{rcl} E & \to & F \\ x & \mapsto & f(x) \\ \end{array}$.
But, in high school textbook, as well as undergraduate textbook, a function is defined just by a formula, $y=x^2$ or $y=\sin(x)$. The domain is seldom part of the definition, but something the student has to compute, hence seen as an inherent property of the formula.
The codomain is, as far as I know, almost never mentioned. Most textbooks focus on the range. Since the range is the smallest possible codomain, I guess it may be for "economical" reasons, but it seems to me that it leads to me to misconceptions about functions. It also leads to shocking sentences like "the function is one-to-one, so it has an inverse" :(.
My question : what the pros and cons of not teaching the notion of codomain of a function?