Identity function

That is, when f is the identity function, the equality f(x) = x is true for all values of x to which f can be applied.

Formally, if X is a set, the identity function f on X is defined to be a function with X as its domain and codomain, satisfying In other words, the function value f(x) in the codomain X is always the same as the input element x in the domain X.

[2] The identity function f on X is often denoted by idX.

In set theory, where a function is defined as a particular kind of binary relation, the identity function is given by the identity relation, or diagonal of X.

Such a definition generalizes to the concept of an identity morphism in category theory, where the endomorphisms of M need not be functions.

Graph of the identity function on the real numbers