First, replace f(x) with y.
So we have now:
y = 3x + 1
Next, switch the x and y.
We get:
x = 3y + 1
Finally, solve for y.
3y = x - 1
y = x/3 - 1/3
So, we have f(x) = 3x + 1, and the inverse of this function is:
[tex]\boxed{f^{-1}(x) = \frac{1}{3} x - \frac{1}{3}}\\\\OR\\\\\boxed{f^{-1}(x) = \frac{x-1}{3}}[/tex]