Is there a purpose behind a function? 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.
 A: Because functions are very handy in describing the world around us. For example, if I ask you the following question:

What happens to the average temperature of a well mixed container of water if I put a hot iron bar into it?

What is the best way to answer this? Well, what really happens is that the moment you put the iron bar into the water, most of the water remains at the same temperature. Then, with each passing second, more heat is transfered from the iron bar to the water, and the temperature of the water is larger after second.
What is the best way to describe this phenomenon? Well, what we are describing is the fact that "over time, the temperature of the water is increasing." This is best done by some sort of mathematical object that will tell us the temperature of the water for each moment in time - A function of temperature depending on time.

The world is full of such examples: examples where not only there is a relation between two quantities, but that one of the quantities is dependent on the other, so that the relation is best described by a function:


*

*The current passing through a wire depends on the potential difference between the two ends of the wire

*The magnitude of the gravitational force between two objects depends on the distance between them

*The angle of the sun at mid-day depends on your geographic location

*The GDP of a nation changes over time

A: 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...)
A: A function , which is a subset of a relation, needs special focus because of its characteristic that it gives a unique output for a unique input. 
A: There are several purposes behind a function, one of which is encapsulation. Encapsulation is not such a big deal for simple functions like $f(x) = 2x + 1$. What about something more complicated like $$f(x) = \sum_{i = 1}^{\lfloor x \rfloor} \frac{2x + 1}{4x + 5 - x}$$ I admit this is a very contrived example, but it gets my point across.
Another purpose is to provide a framework with which to distinguish between one-to-one functions and those that are not one-to-one. For example, $f(x) = x^2 + 1$ is not a one-to-one function: quick, tell me two $x$ such that $f(x) = 10$?
