There are a few different, equivalent, ways of defining the limit of a real function. The first way taught is usually the epsilon-delta definition:
First we need to define a limit point. A limit point c of a set A is a point such that for any natural number n, the interval (c-1\n,c+1\n) contains something in A other than c. So If A=[0,1]u{2} then any number in [0,1] is a limit point of A, but 2 is not (because (2-1/2,2+1/2)=(3/2,5/2) doesn't contain anything in A other than 2).
If you don't get limit points don't worry about it for now, it's a bit of a technical thing and you can forget about it for the second, but we need it to give a precise definition of the limit (otherwise funny things can happen).
Let x_0 be a limit point of the domain of the real function f. Then \lim_{x \rightarrow x_0}f(x)=L if and only if: for every \epsilon>0 there exists a \delta>0 such that if
\left|a-x_0\right|<\delta| and x\neqx_0 then \left|f(a)-L\right|<\epsilon.
Sound straight forward? No not really.
Intuitively speaking the idea is that if we look really close to the point x_0 we get really close to the limit L. Epsilon tells you how close you want the limit L to be to the function f(x) around the point x0. Delta tells you how close you need x to be to x0 so that f(x) is within epsilon of L.
Note that the actual behaviour of the function at x0 is irrelevant.
So a brief example: Show \lim_{x\rightarrow 2}x^2=4
So let's say we've got some epsilon greater than zero. The question is then how close to 2 do we need to be for x^2 to be within epsilon of 4?
Well let us have a look at:
\left|f(a)-L\right|=\left|a^2-4\right|<\epsilon
What do we need for this to be true? Let's factorise the equation:
\left|a-2\right|\left|a+2\right|<\epsilon
So to get a quick idea, suppose \epsilon=1, then we want to find a such that
\left|a-2\right|\left|a+2\right|<1
Well what if a was within .1 of 2 (that is delta=.1)? So 1.9\leq a\leq 2.1 Is that close enough?
Well if that's true 3.9\leq\left|a+2\right|\leq4.2 and \left|a-2\right|\leq.1
So putting it all together \left|a^2-4\right|\leq 4.2*0.1=.42 < 1
So it IS good enough (and so any number smaller than .1 would be good enough too). But what if we wanted epsilon=0.1? Or epsilon=.00000095? Or epsilon=2*10^-54? We could keep guessing but it would get time consuming - we want a prescription that automatically produces a delta for a given epsilon.
So what to we need \delta to be such that if \left|a-2\right|<\delta then
\left|a-2\right|\left|a+2\right|=\delta\left|a+2\right|<\epsilon?
We need to do something about that a+2 term. Let's say delta is less than 1, ideally we want to make it small, so we'll start here. Then
\left|a-2\right|<1 implies .9\leq a \leq 1.1 so 2.9\leq\left|a+2\right|\leq3.1.
Then if \delta\left|a+2\right|<\epsilon
\delta<\frac{\epsilon}{\left|a+2\right|}\leq\frac{\epsilon}{2.9}
So if \frac{\epsilon}<1 then \delta=\frac{\epsilon}{3}<\frac{\epsilon}{2.9} ensures that \left|a^2-4\right|<\epsilon providing \left|a-2\right|<\delta.
If \epsilon\geq1 then you can see that \delta=1 is good enough. So we take \delta=\min(\frac{\epsilon}{3},1).
Finally just to check that it works, look at epsilon=1 again. Our prescription tells us delta=1/3 should work. Then \left|a-2|<1/3 and \left|a+2|<2+1\3=5/3 hence \left|a^2-4\right|<5/9<1, so it works in this case.
So if you tell me you want to be within epsilon of 4, I can tell you that if you're within delta of 2, then x^2 is within epsilon of 4.
Finally note that since we ignore the behaviour of the function at x0 if we had chosen, f(x)=x^2 for x\neq2 and f(2)=1000000 we'd get the same result.