A function is like a machine. You put something in, and something else comes out. When we talk about functions in mathematics, we’re really talking about a connection between variables. This connection can be anything, but it follows a certain requirement. It’s this requirement that defines a function.
Before you move on, it is important that you know and understand the term argument.
An argument in the theory of functions is the number or the expression that you insert into the function. Up until now, you’ve probably thought of the argument as the $x$ in a function.
Theory
If at any given value of $x$, there exists only one value of $y$, you say that “$y$ is a function $f$ of $x$”. You write $y=f(x)$. In other words, the connection that meets the requirement of “only one value of $y$ to a given value of $x$” is a function.
Here is a figure of how you can imagine functions:
You can use a function to:
Find $y$-values when you have $x$-values.
For example, to find the total price of the apples you are buying by weight, when you know the weight of the apples you have picked.
Find $x$-values when you have $y$-values.
For example, to find the weight of apples you are buying by weight, when you’re told the total price of the apples.
Find a connection between a set of $x$-values and a set of $y$-values.
Finding a function that shows a connection between two variables is called regression. For example, to find a function of the price of apples by their weight. You might have a list of the weights of different bags of apples, and a list of how much each bag costs.
Theory
$x$ is called the argument of the function. This is also called the independent variable. That is because you pick the values for $x$.
$y=f(x)$ is called the functional value of the function. This is also called the dependent variable. That is because it is the function that decides what the $y$-value is when you have chosen the $x$-values.