You may need to review function inverses (both the concept and the necessary conditions).
Not all functions with inverses have the inverse across their entire domain because they are not one-to-one across their entire domain; however, if we restrict such functions' domain to sets over which they ARE one-to-one, then an inverse exists over the restricted domain.
When a function has an inverse (regardless of any necessary domain restrictions), BOTH the function and the inverse function must be one-to-one where the inverse exists.
Also, if the domain of a function is {A} and the range is {B}, then the domain of the inverse is {B} and the range of the inverse is {A}.
EG:
f(x) = e^x
Domain of f: {all Real numbers}
Range of f: {all non-negative Real numbers}
f^(-1)(x) = ln(x)
Domain of f-inverse: {all non-negative Real numbers}
Range of f: {all Real numbers}