A function takes every element x in a starting set, called the domain, and tells us how to assign it to exactly one element y in an ending set, called the range. Sometimes functions also have inverses. The inverse of a function f(x) is a function g(x) such that g(f(x)=x for any x in the domain of f(x).

Not every function has an inverse, for better or worse. You can check graphically if a function has an inverse function. Just as we can check if we have a function using the vertical line test, we can check if a function has an inverse function with the horizontal line test: if any horizontal line touches only one point of the graph, then an inverse function exists for the function which the graph represents.

It is interesting to notice that the function and its inverse graphically reflect each other on the coordinate system across the line x = y. Check it out with the example we computed above!