Every function is a relation, or a set of ordered pairs (x,y). Every relation has an inverse relation where you exchange x and y. (For every (x,y) in the relation, the inverse relation has the point (y,x)).
If the function is one-to-one, then its inverse relation is also a function.
Given the graph of a one-to-one function, to graph its inverse you just take each point on the graph `(x_i,y_i)` and plot `(y_i,x_i)` . e.g., if (1,2) is on the function, then (2,1) will be on its inverse.
If done correctly, you will notice that the graph of a function and its inverse are symmetric across the line y=x, or the line y=x is a line of symmetry. Every point on the function has a mirror point across the line y=x on the inverse.