A function has an inverse only if it is bijective, that is, both one-to-one and onto. However, if the codomain of a function is taken equal to its range, then every value in the codomain is already attained by the function. Therefore, the function automatically becomes onto, and only the one-to-one (injective) condition is required for the existence of its inverse.
The graph of a function and its inverse are related through a geometric symmetry about the line . This line is used because any point on a function represents an input-output pair, and for its inverse, the roles of input and output are interchanged:
The line is exactly the set of all points where input and output values are equal, making it the natural axis of reflection for this interchange.