I just finished working through compositions of functions, and what properties the inner and outer functions need to have in order for the whole composition to be injective or surjective. I checked Wikipedia just to make sure I'm right in thinking that for a composition to be injective or surjective, both of the functions need to be injective or surjective respectively. Wikipedia talks about these facts as if functions are totally divorced from the domain and range that's being considered. Composing functions by definition requires that the range of the inner function is the domain of the outer function. Currently Wikipedia says that a composition can be injective even if the outer function is not, because a counter example can exist outside of the range of the inner function. Similarly, that a surjective composition can be surjective even if the inner function is not because the counter example may not be in the domain of the outer function. Doesn't this treat functions has separate entities that aren't partly defined by their domain? Isn't the inner function trivially surjective in the case of compositions because of the requirement that the domain of the outer function be the range of the inner function? Doesn't that same requirement, and the fact that functions are partly defined by the domain and range being considered, also mean that both functions must be injective for the composition to be injective? I'm getting my definitions from Tao's Analysis.