# Why is the concept of a codomain useful?

I don't understand what the point is of specifying the codomain of a function. For example, if I ask, "Given the function f: $\Bbb R$ $\to$ $\Bbb R$, where $f(x) = x^2$, what is the image of f?", how is that any different from asking, "Given the function $f(x) = x^2$ whose domain is $\Bbb R$, what is the image of f?" In both cases, the answer can only be "The set of all real numbers greater than or equal to $\theta$". Supplying the codomain in the first question doesn't add any more useful information.

Maybe a more precise way to phrase my question would be: What's the use of distinguishing between a number that's a part of a function's codomain but not its image, and a number that is neither part of the function's codomain nor its image?

Because a function $f\colon X\to Y$ is formally defined as a subset of $X\times Y$. It is, in fact, defined as its graph (contrary to what you were likely told in Calculus and earlier). You can't ignore $Y$, and changing it changes the function. There are many ways in which we can work around those issues, but that's the technical reason why.
• That makes sense. So would it be wrong to say that if you know the range of a function for a particular domain, then the concept of its codomain becomes useless? For example, if you already know the range of f(x) = x^2, then would you just define Y in the product X $\times$ Y to be the range? – Tyler Nov 17 '13 at 4:58
• Technically, no. The function $\Bbb R\to \Bbb R$ given by $x\mapsto x^2$ is technically different from the function $\Bbb R\to [0,\infty)$ given by $x\mapsto x^2$. Thankfully, this distinction is not usually important outside of set theory. We can pretend one is the same thing as the other in the fairly obvious fashion. So the moral answer is 'yes, once you know the range the codomain is unimportant'. That being said, often times we want to compose many maps in a row, and sometimes it is easier to know the next map makes sense on the codomain than on the actual range. – zibadawa timmy Nov 17 '13 at 5:06