For a function to have an inverse, it needs to have one $x$ for every $y$, and vice versa. You can use the horizontal line test to verify that the inverse of a function is valid. If you can draw a horizontal line and it crosses through two points at the same time at any height, the inverse is not a valid function.