What's happening is that we are plugging some unknown number x into the function, and getting -1 as the result. The function rule is 3*x-7 which translates to "multiply the input number by 3, then subtract off 7"
Notice how multiplication comes first and then we subtract. This is following the order of operations PEMDAS (some books may call it BEDMAS depending on your region). The M for multiplication comes before the S for subtraction.
To isolate x, we follow the order of operations in reverse. We undo the "subtract off 7" then we undo the "multiply by 3"
So this is how it all works out
f(x) = 3x-7
-1 = 3x-7 .... replace f(x) with -1
3x-7 = -1
3x-7+7 = -1+7 ... add 7 to both sides to undo the "-7"
3x = 6
3x/3 = 6/3 ... divide both sides by 3 to undo the "multiplication"