A function is defined as a set of ordered pairs (x, y) where x is an element from a set X known as the co-domain and y is an element from a set Y known as the range.
A necessary condition for a function is that for each value of x there is a unique value for y.
Writing a function as y = f(x), for no two values of x can the value of y be the same.
For example, y = `sqrt x` is not a function as the square root of a number can be a positive number as well as a negative number, for instance the square root of 4 is 2 as well as -2. If a function `y = sqrt x` has to be defined a restriction has to be placed on the values of x, they can either be negative or positive.
Also, for each value of x the function y = f(x) should yield a real value of y.