A Constant Function
An easy example of a function is a constant function. A constant function sends all of the elements of the domain to only one element of the co-domain.
For instance, Assume f : R → R be defined by f (x) = 1. On the other side, we can write
f : x → 1 for all x ∈ R
The graph of f is as shown in given fig.

Generally, the graph of a constant function y: x → c is a straight line that is parallel to the x-axis at a distance of c units from it.