What are functions?
From a birds-eye view, functions are one of the most important concepts in mathematics and computer science, akin to sets and logic. In fact, when you enter into programming, you get to deal with functions a lot more than you deal with sets or the laws of logic.
So given that they represent such a pinnacle concept, let's spare a few minutes in quickly understanding what exactly are functions.
Essentially, a function is a mapping of elements from one set to another set. As simple as that.
Let's say you have three programmers: Alice, Bob, and Carol, and three programming languages: Python, C, and Java. Each programmer must pick up one language to use in a competitive programming competition. Suppose that Alice and Carol both pick Python whereas Bob picks Java.
These choices can perfectly be described by a function; in particular, a function that specifies which language a given programmer uses. Under this function, Alice maps to Python, Bob maps to Java, and Carol maps to Python.
The figure below illustrates this mapping:

Basically, a function is some kind of a mapping from one set to another set — in this case from a set of three programmers to a set of three languages. For this reason, functions are sometimes also referred to as mappings.
Applications of functions
As stated earlier, functions are cornerstone to mathematics and computer science. Let's see the rationale behind this statement.
In discrete mathematics, you'll frequently deal with squares (as in ::x^2::), logarithms, exponents, floors, and ceilings of numbers. All of these are examples of functions.
Furthermore, as you advance into other topics in discrete mathematics, you'll see that functions appear time and time again. For instance, sequences are a special kind of functions. Similarly, relations are a generalization of functions. In combinatorics, there is a whole rich topic called generating functions.
If you focus on computer science only, functions appear in recursion, in hashing, in encryption/decryption, and in database queries. Functions are also used when computing the running times of algorithms. And not only that but functions are trivially seen in almost all mainstream programming languages in one form or another.
In computer graphics, rendering engines rely on transformation functions to map object coordinates across spaces. For example, you might rotate an object by 90 degrees or scale it to double the size; these are instances of transformations of the object.
In short, functions are everywhere in mathematics and computer science. There's simply no escape from them!