to get the inverse of any expression, we start off by doing a quick switch of the variables, then we solve for y, so
[tex] \bf y=3x-2\implies \stackrel{\textit{quick switcheroo}}{\underline{x}=3\underline{y}-2}\implies x+2=3y\implies \cfrac{x+2}{3}=\stackrel{f^{-1}(x)}{y} [/tex]