you're going to have to write f(x) unambiguously using parentheses. From what you've written I can't tell what f(x) is.
is it $f(x) = 3^{x-1} - 2$ ?
if so let
$y= 3^{x-1} - 2$
solve for $x$. Then in your resulting formula for $x$ replace $x$ with $f^{-1}(x)$ and replace $y$ with $x$ and you'll be done.
This method works for whatever $f(x)$ is.
A point about notation: If the original function is given as a function of "x": f(x), then the inverse function will typically also be given as a function of x.
For example, if you are given function f(x)= 4x- 1 then to find the inverse function write y= 4x- 1 and solve for x: 4x= y+ 1 so x= (y+ 1)/4. So you would write the inverse function as .