Determine if a function is invertible