In mathematics, the composition operator ∘ {\displaystyle \circ } takes two functions, f {\displaystyle f} and g {\displaystyle g} , and returns a new function h ( x ) := ( g ∘ f ) ( x ) = g ( f ( x ) ) {\displaystyle h(x):=(g\circ f)(x)=g(f(x))} . Thus, the function g is applied after applying f to x. ( g ∘ f ) {\displaystyle (g\circ f)} is pronounced "the composition of g and f".
Reverse composition, sometimes denoted f ↦ g {\displaystyle f\mapsto g} , applies the operation in the opposite order, applying f {\displaystyle f} first and g {\displaystyle g} second. Intuitively, reverse composition is a chaining process in which the output of function f feeds the input of function g.
The composition of functions is a special case of the composition of relations, sometimes also denoted by ∘ {\displaystyle \circ } . As a result, all properties of composition of relations are true of composition of functions, such as associativity.