To find the inverse of a function, you have to start by replacing the f(x) by y:
Now switch the x and y:
Solve for y:
Finally, replace y by f^-1(x):
The graph of the main function is in red, and the graph of the inverse function is in blue:
As you can see, the graph of the inverse function (blue) is the graph of the main function (red) reflected about the diagonal line y=x (orange). Then, the inverse relationship is verified.