### Range definition

The range of a function is the set of outputs the function achieves when it is applied to its whole set of outputs. In the function machine metaphor, the range is the set of objects that actually come out of the machine when you feed it all the inputs.

For example, when we use the function notation $f: \R \to \R$, we mean that $f$ is a function from the real numbers to the real numbers. From this notation, we know that the set of all inputs (the domain) of $f$ isi the set of all real numbers and the set of all possible inputs (the codomain) is also the set of all real numbers. But, without knowing what the function $f$ is, we cannot determine what its outputs are so we cannot what its range is. All we know is that the range must be a subset of the codomain, so the range must be a subset (possibly the whole set) of the real numbers. It is possible there are objects in the codomain for which there are no inputs for which the function will output that object.

For example, we could define a function $f: \R \to \R$ as $f(x)=x^2$. Since $f(x)$ will always be non-negative, the number $-3$ is in the codomain of $f$, but it is not in the range, as there is no input of $x$ for which $f(x)=-3$. For this $f$, the range is the set of non-negative real numbers while the codomain is the set of all real numbers.