What are functions?

One way to look at functions is as a unit of work. A processing unit. You enter an input, and get in return an output. Say f(x) = x + 1. You take an input, the function does the work for you, and you get the output. This is an easy, even too easy, example. But say you want to calculate the infinite sum of a geometric series (with 0 < q < 1) - this would be a lot of work to do by hand. Luckily for you - there is a formula that can be stated as a function. f(q) = 1/(1-q). Sometimes we look at functions as a processing unit - something to get the work done for us.

Another way to look at functions is as a transformation. You map a value in one domain to a different value in another domain. Here the role of the function is to be a map. You want to know where your position is real life corresponds to your position in the map. A translation. You want to translate a value (word) in one language to another. The reason being that it might be easier to do some operations in one domain over the other.

Another way to look at functions is as an approximation. This is a completely different view on the matter. This view says that the reality is too complex. If you try to model it too precisely you will run out of space and time. So you need a shortcut. Something that is good enough for all practical uses. One such example is the Gaussian function (or distribution). This function can help approximate the binomial discrete distribution. Instead of computing (by hand) the exact probability of getting 321 heads or lower in a 1000 toss game, you could use this shortcut and get an almost precise number.

Checking these three different views give birth to a higher generality - functions are useful abstractions that help us model the reality around us.