This is a little tricky !!!......we want to first get x by itself
y = (2x-1)/(x+2) multiply both sides by x + 2
y(x +2) = 2x - 1
xy + 2y = 2x - 1
xy - 2x = -2y - 1
x ( y - 2) = -(2y + 1 ) divide both sides by y - 2
x = -(2y + 1) / (y - 2) .......now ...."swap" x and y
y = - (2x + 1) / ( x - 2) and for y, write f-1 (x)
f-1 (x ) = - (2x + 1) / (x - 2)