how to determine if a function has an inverse algebraically