Domain and composition of functions