Why codomain might not be taught
A couple of practical reasons why some thing is not pointed out:
- The thing is the same in all cases encountered.
- The thing makes no difference in actual practice.
These principles apply beyond teaching mathematics. One of issues for learners is that one becomes habituated to the seeming uselessness of an unused idea.
I think codomain falls into that category in courses on the high-school algebra thru single-variable calculus track. I don't recall having seen it until later. (This would have been in U.S. schools and international schools with a "U.S." curriculum in the late 1970s.) My current students usually have not seen the word "codomain" or admit to not knowing what it is. The mathematics-interested students in Linear Algebra right now seem interested in the concept and wonder how in the world the idea of codomain could be useful enough for them to have to learn it. Luckily, it is a useful idea in L.A., and I am glad they have such curiosity. I am satisfied that now is the time they are first learning it, and it doesn't seem to be a problem that they have not seen it before.
Historical observation
The OP remarks, in a deprecatory way, about someone who might say, "the function is one-to-one, so it has an inverse." Well, the University of Illinois Committee on School Mathematics (1959) defines a function to be "a set of ordered pairs no two of which have the same first component." The domain and range are derived from the set of ordered pairs. "Codomain" is not mentioned. A function has an inverse if the set of order pairs derived from the function by reversing the order of each pair is itself a function. Thus, in this presentation, if a function is one-to-one, it has an inverse. One thing to keep in mind is that people who were taught this approach are probably still teaching mathematics.
Precalculus motivation
I think the description of the codomain often found in internet searches is confusing. The one I find says that the codomain is the set of all possible values of a function and the range is the set of all actual values of the function. To my mind, the actual values are the only possible values, and I don't see any distinction between codomain and range being made. I have a different way to describe the difference.
Functions in precalculus often arise in the form $y = f(x)$, that is, they model equations. As equations, the value of $y$ is given and $x$ is to be determined. So for each value of $y$, we obtain a problem $y=f(x)$ to be solved. Then the codomain represents all the possible problems that may be posed, the range represents all the problems that have solutions, and the domain represents the set of solutions to all the problems.
For instance, $-1=x^2$ does not have a solution, but $4=x^2$ does. And saying, "there are no real solutions," is a common response to an equation.