Composition of functions

Given f:A→B and g:B→C, the composite g∘f:A→C is defined by (g∘f)(a)=g(f(a))
Composition of functions

Let f ⁣:ABf\colon A\to B and g ⁣:BCg\colon B\to C be with matching /\, . Their composition is the function

gf ⁣:AC,(gf)(a)=g(f(a)). g\circ f \colon A \to C,\qquad (g\circ f)(a)=g(f(a)).

Composition is associative, and the acts as a two-sided identity for composition.

Examples:

  • If f(x)=x2f(x)=x^2 and g(x)=x+1g(x)=x+1 on R\mathbb{R}, then (gf)(x)=x2+1(g\circ f)(x)=x^2+1 while (fg)(x)=(x+1)2(f\circ g)(x)=(x+1)^2.
  • If ι ⁣:AB\iota\colon A\to B is an inclusion and h ⁣:BCh\colon B\to C, then hιh\circ\iota is the restriction of hh to AA.