In general, y = <<stuff happens to x>>
The problem is there are an infinite number of answers for what x =
Here's the simple answer:
If:
y = -2x
Then:
4 = -2x
(divide by -2 on both sides)
-2 = x
Here's a more complicated possibility:
y = x^2 - x -2
y = 1^2 -1 -2
y = -2
4 = x^2 -x -2
0 = x^2 -x -6
0 = (x - 3) (x + 2)
x = -2 or +3
You can continue making more and more complicated functions- y = <<more and more complicated stuff happening to x>>
The answer your teacher is probably looking for is x = -2, but the most technically correct (the best kind of correct) answer is probably x = any real number.