Answer
$f^{-1} (x)=-x+2$
Work Step by Step
When we apply the horizontal test, it has been noticed that the function is one-to-one and verifies the horizontal test.
Therefore, the function has an inverse function.
To compute the inverse, we will have to interchange $x$ and $y$.
$y=-x+2 \implies x= -y+2$
or, $-y=x-2$
Replace $y$ with $f^{-1} (x)$.
so, $f^{-1} (x)=-x+2$