Explanation:
You can take the inverse of a function by replacing all x-values in the equation with y-values and vice versa and subsequently solving for y:
Equation given:

Replace all x-values with y and all y-values with x:

Solve for y:

This is the inverse of f(x), where x ≠ 2..