You were close, and have the right idea, but I think you did it a bit backwards! You want to "flip" it over the y=x line (picture attached below)
To solve for the inverse, you will find the equation of the original, switch the x and y, then solve for y.
We can (mostly, I think?) tell the equation for f(x) is as follows, so we switch the y and x for the steps following to solve for y:
[f(x)] y = -2x + 2
[switch] x = -2y + 2
[subtract 2 from both sides / flip equation] -2y = x - 2
[divide both sides by -2] y = -2x -4
So our equation for g(x) will be about y = 2x -4
(inverse so the negative is weird)
Photos:
- first is y=x
- second is the general idea of the inverse for what g(x) should look like
- third is kinda what the graph will look like (digitally)
I know this isn't a *perfect* answer, but I hope it explains it some and helps. Good luck! :D