In mathematics, especially in the fields of group theory and representation theory of groups, a class function is a function on a group G that is constant on the conjugacy classes of G. In other words, it is invariant under the conjugation map on G. Such functions play a basic role in representation theory.