Like so:
\(y = \frac{3x-7}{x+1} \text{ Solve for x }\\ y(x+1)=3x-7\\x(y-3)=-(y+7)\\x = -\frac{y+7}{y-3} \text{ swap y and x and replace y by f^{-1}(x) }\\f^{-1}(x)=-\frac{x+7}{x-3}\)