Official solution
Assume,
y = f(x)
\[ \Rightarrow \] y = \[{{x - 1} \over {x - 2}}\]
\[ \Rightarrow \] yx - 2y = x - 1
\[ \Rightarrow \] (y - 1)x = 2y - 1
\[ \Rightarrow \] x = \[{{2y - 1} \over {y - 1}}\] = f -1(y)
As on the given domain the function is invertible and its inverse can be computed as shown above.