show/hide this revision's text 2 added 4 characters in body

It is called "generalized inverse". In that case $fg$ and $gf$ are idempotents. In particular, if you have a semigroup of maps $X\to X$ (i.e. a set of maps closed under composition) such that every $f$ has a generalized inverse, the semigroup is called {\em regular} regular. If the generalized inverse is unique, the semigroup is called {\em inverse} inverse. See Clifford and Preston "Algebraic theory of semigroups".

show/hide this revision's text 1

It is called "generalized inverse". In that case $fg$ and $gf$ are idempotents. In particular, if you have a semigroup of maps $X\to X$ (i.e. a set of maps closed under composition) such that every $f$ has a generalized inverse, the semigroup is called {\em regular}. If the generalized inverse is unique, the semigroup is called {\em inverse}. See Clifford and Preston "Algebraic theory of semigroups".