The range of f is sometimes denoted ran(f).
The range should not be confused with the codomain B. The range is a subset of the codomain, but is not necessarily equal to the codomain, since there may be elements of the codomain which are not elements of the range. Another way to think about this is to consider the codomain to be the set of all possible output values, while the range is the set of all actual outputs. Beware that sometimes the codomain is incorrectly called the range because of a failure to distinguish between possible and actual values. A function whose range equals its codomain is called onto or surjective.
Let the function f be a function on the real numbers:
- f(x) = x2
Now let g be a function on the real numbers:
- g(x) = 2x
In this case the image of g equals R, its codomain, since, for any real number y,
- g(y / 2) = y.
In other words, g is onto R.