A function f is said to be one to one if for any x0,x1 in the domain of f, f(x0)=f(x1) implies x0=x1. In other words, there is only one element in the domain of f that maps to any given element in the range of f.
We will first show that f(x)=3x−1 has this property. Suppose x0 and x1 are real numbers such that f(x0)=f(x1). Then
3x0−1=3x1−1
⇒3x0=3x1
⇒x0=x1
Thus f(x)=3x−1 is one to one.
As f(x) is one to one, it has an inverse function f−1(x) where f−1(f(x))=f(f−1(x))=x.
One way of finding f−1 is to set y=f(x)=3x−1, change all the x's to y's and vice versa, giving x=f(y)=3y−1, and then solve for y. This results in an equation of the form y=f−1(x).
Set x=f(y)=3y−1
⇒x+1=3y
⇒y=x+13=f−1(x)
Notice that given f−1(x)=x+13 we have f−1(f(x))=f(f−1(x))=x, as desired.