In order for a function to have an inverse that is also a function there are 2 main requirements:
1. The function should be bijective (ie) the function should be one-one ( each element in codomain has not more than 1 pre image in domain) and onto ( Range should be equal to codomain)
2. The inverse function should be defined by a suitable domain and range
Hope this answer helps you..