As I understand it, a function is a relation between two sets of numbers where as for every input value there is only assigned one output. Or for every $x$ there is only one $y$.
What I don't understand is why distinguish a function in a first place. I mean we could've just as easily defined it as a relation between two sets of numbers, period. Or even done the opposite and $y$ assign one $x$. Usually things in math make sense, not just memorizing a definition. I'm just trying to figure out what's so special that condition; what it might facilitate.
Try yourself to define precisely a deterministic process, meaning something that has a definite outcome for some given initial conditions. I think you will end up with something similar to the definition of a function.
Life as we know it revolves around the concept of determinism. Without getting to philosophical, we have: computer algorithms give the same output whenever the same input is given, machines are also built so that they do the same thing under the same circumstance. More generally, it is a principal of classical mechanics that the behavior of a system (for example, orbiting planets, or a spring, more generally some system of forces) is determined uniquely by the initial conditions of that system (the position and velocities of all the particles).
So deterministic systems are pretty important - I am sure you can think of more. That is one reason why we study functions - there are others (to give a vague example you may understand better later, studying the functions of the right type between different mathematical things can be a useful way to get at more basic questions), but I think this is the most important one to begin with.
(A boring but illustrative example for the vague example above, certainly not due to me but some forgotten genius: suppose I want to know if there are the same number of people in a room as there are chairs. Without counting, I can ask everyone to sit down, and then see if there are any chairs left over, or any people without chairs. This is a particular example of an application of the concept of a function... here the existence of a function (no person will sit in two chairs) can tell me something, though really there is the extra information that I don't want two people to sit in the same chair, and I want every chair to hold at least one person. Often difficulty "counting" problems can be dealt with in this way...)