Summary
A function is something that takes in a number, changes it according to some rule, and spits out another number. That's it. That's all. The rest is notation.
Simpler Definition
When I was in 4th and 5th grade, when we talked about functions, we talked about them in the context of function "machines" - those cute little things that took in a number and spit another one out, something like these tables:

Later, the rules would get harder. And the rules were what were called "functions". So this is what a function is, at its most fundamental level: something that takes in a number, and spits out another number according to a predetermined rule.
Middling Definition
Then, in 6th or 7th grade, we started talking about functions as equations. These rules from the function machines could be written as equations, that took in an input $x$ and spit out an output $y$. These functions could be graphed on the Cartesian plane, like so:

We learned that the points on this line were representative of inputs and outputs - the x-coordinate represented the input, and the y-coordinate represented the output. The equations, of course, could be more complex, and you could also write them as $f(x) = x$ (instead of $y=x$) and we were told this was function notation, and it would be useful later.
Set Theory Definition
More recently, outside of school, I learned the more formal definition of a function, using set theory. First, a few quick pieces of terminology/notation, and we'll be on our way.
The "naive" definition of a set is that a set is a collection of any number of objects, normally numbers but sometimes other things. This actually turns out to be not quite right, and if you follow it along far enough, it leads to a paradox called Russell's Paradox, but for our purposes, we can stick with this definition. So we might have a set like $A = \{4,5\}$ and a set $B = \{4,5,6\}$.
First, we can define an element of a set - that is, a number or object that is within that particular set. For example, here we can say $4 \in A$, or that $4$ is in $A$. We can also define a subset of a set. To be a subset of another set, the supposed subset's elements must all be in the other set. For example, $A$ is a subset of $B$ (written $A \subset B$) because $4$ and $5$ are both in $B$.
Next, we can define multiplication of sets. To do this, I'd like to use two different sets for the example, so we'll define the sets $A = \{a,b\}$ and $B = \{c,d\}$. The answer here is not quite what you might expect - it is $A \times B = \{(a,c),(a,d),(b,c),(b,d)\}$. In other words, it is the set of ordered pairs that can be created from the two sets such that the ordered pair is of the form $(x, y)$ where $x \in X$ and $y \in Y$.
Another important thing to keep in mind here is the set of all real numbers, $\mathbb{R}$. If we do $\mathbb{R} \times \mathbb{R}$ (which can be rewritten as $\mathbb{R}^2$) we get the set of all real coordinates in the second dimension. This makes sense, especially if you think about $\mathbb{R}$ as being the set of all real coordinates in the first dimension. You can further think about this as $\mathbb{R}^n$ being the set of all real coordinates in the $n$th dimension. Cool, huh?
Carrying on, let us define a relation, another key piece of the puzzle. A relation $R$ between two sets, $X$ and $Y$ is a subset $R \subset Y \times X$. To say that $x \in X$ is related to $y \in Y$ we can write $yRx$. So, what exactly does this mean? Well, let's consider the relation $=$ on $\mathbb{R}$. It is the line $y=x$! Does this make sense? We are dealing with the set of all real numbers and have effectively set up a connection between some value $x$ in the set of all real numbers and some value $y$ in the set of all real numbers. We've created what is almost a function!
So, now we get to functions. A function $f$ between $X$ and $Y$ is written $f: X\rightarrow Y$. It is a relation on $Y \times X$ such that $yfx$ and $y'fx$ implies $y=y'$ - in other words, a function is a relation that "maps" or connects every $x$ to a unique $y$.
Uses
Oh, man. There are so many uses for these things I don't know where to start! They're used for anything that involves taking in a number, changing it according to a rule, and spitting out a new one, obviously. Many disciplines do this sort of thing, like physics, economics, engineering, computer programming, finance, and I could keep going. Functions could be thought of as one of the most widely used mathematical tools.
Finally, something to consider here, is behind all of these mathematical definitions and all of this notation is a fundamental idea: quantities in our world are related, and we can show how they are related using simple rules! Think about a circle. The radius of the circle is related to the area of the circle by a simple equation - $A = \pi r^2$. That's a function! It takes in a number, $r$, and spits out a number, $A$.
Example
I'm going to define a distance function here, a metric. Imagine a set $X$ with a function $d: X\times X \rightarrow \mathbb{R}$ such that
- $d(x,y) = d(y, x)$ for all $x,y \in X$ - in other words, the distance between two numbers is the same whether they are listed one way or another.
- $d(x, y) \geq 0$ with $d(x,y)$ only equal to zero if $x=y$ - basically, distance can't be negative, and the distance can only be zero if it is the same point.
- $d(x,y) \leq d(x,z) + d(z,y)$ for all $x, y, z \in X$ - this is known as the Triangle Inequality, and a quick illustration should make it pretty clear.

Sorry, pretty lopsided triangle, but oh well. The distance between $x$ and $y$ cannot be greater than the distance between $y$ and $z$ plus the distance between $y$ and $x$, which really makes a whole lot of sense. You can only increase the distance by adding another point.
So we just defined a distance function! Not so bad, really.
Specific Questions
Okay, last bit, to answer your specific questions.
- $y=f(x)\rightarrow$ This is one of the main reasons I have difficulties understanding functions...What does the above statement
tell me, and if $y$ is a function why do we use $y=$ at all for a
formula like $y=mx+by$ would it be the same as writing $f(x)=mx+b$?
- Something like $y=x^2$ is apparently a function...... but where is the function name? Which is the input and which is the output?
- Lastly another example : Let me suppose $f=$ distance $f(t)=t^2$ $f(2)=4\rightarrow$ Does this mean distance is 44.. which is the input
which is the output?
- I will be updating with the answer to this one.
- Yes, it is a function - $y$ is the output and $x$ is the input. You can rewrite it as $f(x) =x^2$ if you wanted. This is just another way to write the basic concept.
- I will be updating with the answer to this one.
Finally...
There are several things that can be done with functions, like composition, and all sorts of other stuff that would take a bit to go into here (hmm...maybe I'll add some of that at a later date). For now, I'd recommend looking at the wikipedia page on functions, and sites like Khan Academy, and of course asking questions when you have them.
Hope this helps!