Example: Find the inverse function of \(f(x)=\frac{1}{1-x}\). Then verify the correctness of your work.
Solution:
$$
\begin{align}
y &= \frac{1}{1-x}, \,\,\, \text{then swap the variables}\\
x &= \frac{1}{1-y}, \,\,\, \text{next solve for } y\\
x(1-y) &= 1 \\
x-xy &= 1 \\
x-1 &= xy \\
\frac{x-1}{x} &= y \\
y &= 1-\frac{1}{x}, \,\,\, \text{finally, declare victory by saying that}\\
f^{-1}(x) &= 1-\frac{1}{x} \,\,\, \checkmark
\end{align}
$$
Verification of correctness:
$$
\begin{align}
(f^{-1}\circ f)(x) &= f^{-1}(f(x)) \\
&= f^{-1}\left(\frac{1}{1-x}\right) \\
&= 1-\frac{1}{\frac{1}{1-x}} \\
&= 1-1\div \frac{1}{1-x} \\
&= 1-(1-x) \\
&= 1-1+x\\
&= x
\end{align}
$$
Also, the opposite order
$$
\begin{align}
(f\circ f^{-1})(x) &= f(f^{-1}(x)) \\
&= f\left(1-\frac{1}{x}\right) \\
&= \frac{1}{1-\left(1-\frac{1}{x} \right)} \\
&= \frac{1}{+\frac{1}{x}} \\
&= 1\div \frac{1}{x} \\
&= x
\end{align}
$$