Solution:
Key idea: We prove one-one by assuming equal images, and onto by solving f(x)=y for each y∈B and checking the answer lies in A. The formula found for onto is then the inverse.
Step 1 — Assume two inputs have the same image. Take x1,x2∈A with f(x1)=f(x2) and cross-multiply (both denominators are non-zero because x1,x2=2).
x1−2x1−1=x2−2x2−1
(x1−1)(x2−2)=(x2−1)(x1−2)
Step 2 — Expand both sides. We multiply out each bracket.
x1x2−2x1−x2+2=x1x2−x1−2x2+2
Step 3 — Cancel and collect. The terms x1x2 and 2 cancel; we then move the x1 terms to one side.
−2x1−x2=−x1−2x2
−x1=−x2
x1=x2
So f is one-one.
Step 4 — Solve f(x)=y for any y∈B. Take y=1 and make x the subject.
x−2x−1=y
x−1=xy−2y
xy−x=2y−1
x(y−1)=2y−1
x=y−12y−1
The division is allowed because y=1.
Step 5 — Check that this x lies in A. We must show x=2, so suppose it equals 2.
y−12y−1=2
2y−1=2y−2
−1=−2
This is impossible, so x=2 and x∈A. Hence every y∈B has a pre-image, and f is onto.
Step 6 — Write the inverse. From Step 4, f−1(y)=y−12y−1; we rename y as x. The inverse maps B back to A.
Therefore, f is one-one and onto, and f−1(x)=x−12x−1, for x∈R−{1}.