For functions and , their function composition is , defined by . The rightmost function is applied first. Matching the intermediate codomain and domain of a function makes the expression well-defined.
For self-maps of the real numbers, take and . Then , whereas . Thus function composition need not be commutative. It does have the associative property: both and evaluate to whenever each intermediate codomain matches the next domain of a function. The identity function leaves composition unchanged, making self-maps particularly useful as a monoid of transformations.
For and , the following implications hold. If both are injective, equality of two composite images can be cancelled first through and then through , proving that is injective. Conversely, if is injective, equality under implies equality under the composite, so is injective. If is surjective, every is , so is surjective.
There are two useful strengthened cancellation rules. If is injective and is surjective, lift any with to preimages under ; composite injectivity then proves . If is surjective and is injective, apply composite surjectivity to and cancel to find a preimage of every . Neither strengthened conclusion follows from the composite property alone.