Let's try it like this.
\(\displaystyle u = 1 - x \implies x = 1 - u \implies x^2 = 1 - 2u + u^2.\)
\(\displaystyle \therefore f(1 - x) = f(u) = \dfrac{x^2 - 2x - 4}{2 - x} = \dfrac{(1 - 2u + u^2) - 2(1 - u) - 4}{2 - (1 - u)} \implies\)
\(\displaystyle f(u) = \dfrac{1 - 2u + u^2 - 2 + 2u - 4}{2 - 1 + u} = \dfrac{u^2 - 5}{1 + u}.\)
Let's check.
\(\displaystyle f(1 - x) = \dfrac{(1 - x)^2 - 5}{1 + (1 - x)} = \dfrac{1 - 2x + x^2 - 5}{2 - x} = \dfrac{x^2 - 2x - 4}{2 - x}.\)
It checks.
Therefore what is \(\displaystyle f \left ( \dfrac{1}{x} \right ).\)