nLab
function

A function is a functor between sets. (Recall that a set is the same as a category with only identity morphisms.) The functoriality structure becomes the property that a function preserves equality:

(1)x=yf(x)=f(y).x = y \Rightarrow f(x) = f(y) .