Inverse of function, containing a fraction This is basic, I know, but I cannot seem to come up with the right answer.

Find the inverse of the function:
$$f(x)= \frac3{x+1}$$

My steps:
1. Convert f(x) to y
$$y = \frac3{x+1}$$


Switch places of x and y
$$x= \frac3{y+1}$$
Try to solve for y. So I multiply the denominator by x to get rid of it
$$x(y+1) = 3$$
After multiplying, I'm left with
$$xy + x = 3$$
Which then converts to
$$2xy = 3$$
Then I get rid of 2x on the left, placing it on the right
$$y = 3 - 2x$$
Now I convert y to the inverse function
$$f^{-1}(x) = 3 - 2x$$


My answer is obviously wrong. The correct answer is:
$$f^{-1}(x) = \frac{3-x}{x}$$

Where did I mess up?

Thanks!
Step 4 is wrong, check it. instead, divide by x after step 2, and carry over 1.
$XY+X=3
\\XY=3-X
\\Y=(3-X)/X$

This is correct steps after step $3$