Now consider the linear function $f(x) = mx + b$.

When $m = 0$, the function $f$ has the same constant value $b$ for any $x$. So $f$ will have no inverse function.

It is also apparent algebraically that if $m \ne 0$, that $f$ is a one to one and onto and therefore $f$ has an inverse function.

This is covered in most beginning and intermediate algebra courses.

In the next examples we use mapping diagrams to check that one linear function $g(x) = m_g x + b_g $ is the inverse of the given function $f$ by looking at the composition functions $(f \circ g)(x) = x$ and $(g \circ f)(x) = x$.

Inverses for $f_m(x) =m*x$ and $f_{+b}(x)=x+b$ are quite simple: $f_{1/m}(x) =1/m*x$ and $f_{-b}(x)=x-b$.

ii)Suppose $f(x) = x +2$. Verify that $g(x) = x - 2$ is the inverse function for $f$.

** **Since all linear functions can be constructed using
these simple linear functions with composition (Theorem LF.COMP),
finding the algebraic expression for the inverse of $f$ can be
interpreted visually by composing the inverses of $f_m(x)
=m*x$ and $f_{+b}(x)=x+b$ in the reverse order ("socks and
shoes").

** **

You can use this next dynamic example to investigate visually whether a function $g$ is the inverse of $f$ with the mapping diagrams and the graph of $f$.