Function composition and inverse functions