A function as we have discussed is a relationship between two sets, where each element in the first set has exactly one corresponding element in the second set. If we think of candies which cost 10 cents each, then we can say that 1 candy costs 10 cents, 2 candies cost 20 cents, 3 candies cost 30 cents, and so on. We can think of this relationship as a function since for each number of candies, there is only one possible price.
If we consider the relation y = 2x, then we can say that it is a function since for every value we substitute to x, there is one and only one corresponding value for y. For instance, if x = -3, then y = -6 and and if x = 9, then y = 18 (one y for each x). » Read more