Short answer:
it can't because there are two values of x that give each value of y, hence the inverse is not a function (one input produces a unique output).
Long answer:
If you restrict which values of x you put in so that each value of y is given by a unique value of x you can then define an inverse function.
For example:
y = x^2
9 = x^2 has solutions x = 3, and x = -3. A function only produces one output for any input but the inverse in this case could have to produce 2 values, 3 and -3.
If you restrict the values of x to x > 0, then the solution to 9 = x^2 is x = 3 because this is the only solution which is greater than zero. This means the inverse function only produces one output, so can be defined.
If f(x) = x^2, then f^-1(x) = sqrt(x), where sqrt(x) represents the positive root.
You can tell if an inverse function can be defined by drawing a horizontal line through the function. If each horizontal line only intersects the graph once, then then there is an inverse function. If a line intersects the graph more than once then there is not a unique inverse, so there cannot be an inverse function.