How do you solve an inequality when functions are used in the equation? I'll give an example. Lets say we have the inequality:
$-3x + 2 > 20 $
$-3x > 18 $ (subtracting 2 from each side)
$x < -6$ (dividing each side by -3 and flipping the sign)
Now if I were to say that I have a function $f(x) = -3x$ and it's inverse $f^{-1}(x) = -\frac{x}{3}$ and I decide to use this function in the inequality.
$f(x) + 2 > 20 $
$f(x) > 18$ (subtracting 2 from both sides)
$x > f^{-1}(18)$ (applying its inverse to both sides)
If we were to actually write out the inverse
$x > -\frac{18}{3}$
This would be wrong.  In this instance we can just write it out in it's raw form and solve it as it was meant to be solved but when you have more complex functions that don't necicarally have a clear "raw form" how are we meant to know when to flip a sign?

edit: I have fixed a mistake I made where I put in $f(x)^{-1}$ and called that the "inverse function" I mean't to use this notation: $f^{-1}(x)$ - I thought making this change would be good for clarification for first time readers and decided to put this note down so you guys might understand why some comments are mentioning it.
 A: The error in your procedure lies in this part:
$$f(x)>18 \implies x>f^{-1}(18).$$
That's because $f^{-1}(x)=\frac{-x}{3}$ is a $\textbf{decreasing function}$, that is, for any tuple of numbers $a,b$:
$$\text{if } a < b \implies f^{-1}(b)<f^{-1}(a).$$
So, the correct thing to do is:
$$f(x)>18 \implies f^{-1}(f(x))<f^{-1}(18)\implies x<\frac{-18}{3}=-6$$
Then $x<-6.$
A: First note that $f^{-1}(x)$ is the inverse of $f(x)$ while $f(x)^{-1} = \frac{1}{f(x)}$ which are different things.
In general you can't apply a function to both sides of an inequality but you can if they're monotone and you apply them correctly. This isn't hard to see since by definition a function is monotone increasing if $x\leq y$ then $f(x) \leq f(y)$ and you can make similar claims about monotone decreasing functions or strict inequalities.
This can be true for a function and its inverse such as $f(x)=e^x$ which has $\log x$ as inverse and they're both monotone so it's allowed. However with $f(x)=-3x$ This is a monotone decreasing function so you can't apply it here. If it was $f(x)=mx$ with $m > 0$ then it would be increasing and so allowable. Functions that are increasing on a region can be useful too if you're in that region, so say for example $x^2$ is decreasing but for $x \geq 0$ it's monotone increasing so you can use it.
As for sign flipping instead of thinking of it as multiplying by $-1$ and reversing the inequality $x<y$ add $-x-y$ to both sides which gives you $-y < -x$ without appealing to multiplication. You can think of it as first subtracting off the $x$ and then the $y$ too which helps some people. Since sign errors are common when multiplying I find this helps avoid them.
