A function basically explains the relationship between two values (or variables).
It tells you what happens to one variable, for every given value of the other one.
See it as a machinery that orks such that, whenever you input raw materials, a finished product will be the output.
In math, a function works in such a way that, you can get the value of an output (usually represented by letter y) if you have the value of the input (usually represented by letter x).
For example;
is a function, and it shows that you can get the value of y, if you insert a value for x. In this illustration, y is the output, while x is the input.
Y depends on X, and the value of the output y will always change depending on the value we are given for x the input
Another example of a function is;
The set of numbers shown is a function and it means, for every value of x, there is a value for y. That is why you have an ORDERED PAIR such as (1, 2), (2, 4) and so on. The number on the left is the input, while the number on the right is the output