First, to find the inverse of a function, call the original function "x" and call call "x" in the original function as the inverse function:

Now, we solve for the inverse function:

To graph lines, we can find two points in it and draw a line that passes through both.
Let's pick x = 0 and x = 1 for the first equation:

So, we plot the points (0, 1) and (1, 6).
For the inverse, we can simply invet the coordinates, which is the same as picking x = 1 and x = 6:

Thus, we have the points (1, 0) and (6, 1).
The line y = x is jus the diagonal that passes though point (0, 0) and (1, 1), for example.
Putting these points and drawing the lines, we get: