Understanding inverses of functions