Functor

Let C and D be categories.
A (covariant) functor F:CD consists of:

  1. Identity preservationF(idX)=idF(X).
  2. Composition preservation
    For all morphisms f:XY and g:YZ,F(gf)=F(g)F(f).

Thus, functors preserve identities and composition.

The category of (small) categories.
Categories themselves form a category, commonly denoted Cat:

An important relationship between functors is adjunction.

Related: natural transformation.