Even if it fails the horizontal line test, you can usually break off the part of the function that's relevant, and find the inverse for that. For example, there is no inverse for y=x^2. However, there is an inverse for y=x^2 for x > 0 (namely, the square root function).
