In Definition 7.2 we had introduced the image of an element of the domain under a function. The set of all these images is called the image of the function.
Definition7.13.Image of a function.
The image of a function \(f:A\to B\) is
\begin{equation*}
f(A) = \left\{ f(x) \mid x \in B \right\}.
\end{equation*}
For all \(x\) in the domain of \(f:A\to B\) we have \(f(x)\in B\text{,}\) thus the image \(f(A)\) of \(f\) is a subset of codomain \(B\) of \(f\text{.}\)
Example7.14.
Let \(f:\mathbb{Z}_5\to \mathbb{Z}_5\) be given by \(f(x)=x^2\bmod 5\text{.}\) Then
\begin{equation*}
f(\mathbb{Z}_5)=\left\{ f(x) \mid x \in \mathbb{Z}_5 \right\}=\{0,1,4\}.
\end{equation*}
Note that this differs from the codomain of \(f\) which is \(\mathbb{Z}_5=\{0,1,2,3,4\}\text{.}\)
In Section 7.1 we defined functions by algebraic expressions or tables of charts. Another way of representing a function is its graph. Instead of organizing the values in a table we consider them as elements of a Cartesian product. We give an introduction to graphs of functions in the video in Figure 7.15. It is followed by a more detailed discussion.
Definition7.16.Graph of a function.
The graph of the function \(f:A\to B\) is
\begin{equation*}
\left\{ (x,f(x)) \mid x \in B \right\} \subseteq A\times B.
\end{equation*}
In Example 7.17 we obtain a graphical representation a function by applying the graphical representation of Cartesian products from Section 6.3 to the graph of the function.
Example7.17.
Let \(f:\mathbb{Z}_{6}\to\mathbb{Z}_{5}\) be given by \(f(x)= 2^x \bmod 5\text{.}\)
The graph of \(h\) are the elements of the Cartesian product \(\mathbb{Z}_{10}\times\mathbb{Z}_5\) which are represented by the black pixels in the plot. We find that the graph of \(h\) is
\begin{equation*}
\{ (x,h(x)) \mid x \in A \} = \{
(0,2),
(1,0),(2,0),
(3,1),
(4,0),
(5,1),
(6,0),
(7,4),(8,4),(9,3)
\}.
\end{equation*}
Because the graph of \(h\) consists of the pairs \((x,h(x))\) where \(x\) is an element of the domain of \(h\text{,}\) we can read off the values \(h(x)\) easily.
In Example 7.19 observe how changing the plot of the graph of a function changes its graph.