Informal limit and continuity of a single variable function
(not to scale)
What does it mean to calculate a limit? The intuitive idea of a limit is that of a boundary. At some point in school we learn to solve inequalities and the answers are usually a range of values, such as [1, 7] or ]0, 2[. A closed interval means that the variable can assume any value close to it, including the boundary value itself. An open interval means that the variable can assume any value close to it, except for the boundary value itself. Another way to see it. Suppose we take a number and divide it by 2 and repeat it as many times as we want to. We know that it'll get smaller and smaller but not past zero. That's the intuitive notion of a limit.
Now for the notation:
[math]\displaystyle{ \lim_{x \ \to \ a} f(x) = L }[/math]
As [math]\displaystyle{ x }[/math] approaches, gets near, [math]\displaystyle{ a }[/math]. [math]\displaystyle{ f(x) }[/math] approaches, gets near, [math]\displaystyle{ L }[/math]. For this level of calculus what we are doing is inputting variables closer and closer to [math]\displaystyle{ a }[/math] and seeing what happens to [math]\displaystyle{ f(x) }[/math]. If the limit is converging to [math]\displaystyle{ f(a) }[/math]. Then great, we can calculate the value of the function there and it's going to be equal to the limit. Else, it's diverging to some other value, then we have some form of fracture in the function's graph. Not quite the most rigorous way, but it suffices for now. A natural question that may arise here: what about the speed at which we are getting closer to [math]\displaystyle{ a \ ? }[/math] That's more a physics concern than a mathematical one. In calculus our only concern is whether that limit exists or not. That point being reachable or not is another problem.
Some exercises try to trick us with a piecewise function. Suppose that one case defines the function for [math]\displaystyle{ f(0) = 0 }[/math]. The other case defines that the function obeys [math]\displaystyle{ f(x) = 1/x }[/math]. What happens if we calculate the limit as [math]\displaystyle{ x \ \to \ 0 \ ? }[/math] Don't be fooled by [math]\displaystyle{ f(0) = 0 \ !! }[/math] The limit is taking the independent variable as close as we want to zero, but just one small step away from it.
Limits of intuition: (pun) the hardest limits to calculate are those that defy intuition. For example: [math]\displaystyle{ \lim_{x \to 0} \ (\sqrt{x^2 + 9} - 3)/x^2 }[/math]. If we apply [math]\displaystyle{ x = 10^{-10} }[/math], the value seems to converge to zero. But if we solve the limit analytically, not numerically, the result should be [math]\displaystyle{ 1/6 }[/math]. Machines don't have infinite precision, the error comes from [math]\displaystyle{ \sqrt{9.000...1} = 3 }[/math]. Rounding errors is one of the fundamental problems of numerical methods.
The other case that defies intuition are limits that don't exit and yet are somewhere in between known values. That's the case of [math]\displaystyle{ \sin(1/x) }[/math] for example. We know that [math]\displaystyle{ -1 \lt \sin(x) \lt 1 }[/math]. When [math]\displaystyle{ x \to 0 }[/math], [math]\displaystyle{ \sin(1/x) }[/math] can assume any value between -1 and 1, it never converges to a certain fixed value. We know that the function is bounded between two fixed values, but in between them it never "stays still". This concept is important. When we have products of functions and one of them is bounded, we know that whatever value the bounded function assumes, it's not infinity. When we do that we are, in fact, relying on the squeeze theorem.
Discussion of continuity
What does it mean for something to be continuous? Without resorting to a precise mathematical definition, the property of being continuous means that something doesn't have gaps or fractures in between it's beginning and ending points. Think about water. At school we learn that water, down to the molecular level, is composed of a large number of molecules. Water is a continuous fluid, there is no space in between molecules of water (I'm disregarding any measures of the size of atoms or molecules). Now snow is still composed of water, however there is a lot of free space in between snowflakes. Snow is not continuous. Now let's think about rain. We can say "it's been continuously raining for days". Water, in the form of water droplets, is discontinuous. For the purposes of daily life we don't need a precise definition of continuity. For the purposes of math we do need a definition that doesn't allow us to confuse continuity with discontinuity.
Graph A is of a continuous function. Graph B is of a discontinuous function. Now be careful! Being continuous does not mean the same thing as being smooth. Look at the graph of [math]\displaystyle{ f(x) = |x| }[/math] at the origin is not a smooth curve, but it's continuous. The opposite can also happen, a function that is a straight line and yet is discontinuous at some point. Example: [math]\displaystyle{ f(x) = \frac{x^2 - 1}{x - 1} }[/math] has an obvious point where a division by zero occurs, yet the graph is a continuous straight line. We can think about discontinuity in terms of physics. Suppose an object at t = 1s has a velocity of 10 m/s. Now at t = 1.0000...1s the velocity has changed to 1000 m/s. Is it physically possible for the velocity of object to change that much in that little time? Infinite acceleration doesn't exist and that would equate to [math]\displaystyle{ \tan(\pi/2) }[/math] in this case. We've just discussed the concept of a derivative, which is a special case of a limit.
A natural question arises when we think about continuity. A function can be discontinuous at some point. Can we have a function that is discontinuous at every point? Such function exists and is easy to define. Let it be a piecewise function where [math]\displaystyle{ x }[/math] can assume the values 1 or 0, depending on whether [math]\displaystyle{ x }[/math] is rational or irrational. Without going through proofs, suppose we have the numbers [math]\displaystyle{ a }[/math] and [math]\displaystyle{ b }[/math] with [math]\displaystyle{ b \gt a }[/math]. Suppose that [math]\displaystyle{ a }[/math] is rational. Is [math]\displaystyle{ b }[/math] rational or irrational? We can prove that in between two rational numbers there is always some irrational number. The opposite is also true, in between two irrational numbers there must be some rational number. That means that in between two points of that function there is a always a gap, the function is never continuous. No matter how small the difference between two rationals or two irrationals is, we can't have two consecutive rationals or two consecutive irrationals.
An informal discussion for the above theorem: take the number [math]\displaystyle{ \pi }[/math]. Now add one. Now we have two irrationals, 3.14... and 4.14... Which rational can be in between? 3.5 for example. Now, can you see that in between 3.14... and 3.5 there must be infinitely many rationals and irrationals? In between any two rationals or irrationals we can keep subdividing into even smaller intervals and still find a number in between. We are disregarding the question of whether there are more rationals or more irrationals. Counting elements of a set is a different matter.
Can a function have many many points in which it's discontinuous but no everywhere as the example above? Divide a function by a sine or cosine, every time we get to divide by zero the function is going to be undefined. That is a function with an infinite quantity of discontinuities, yet not everywhere. It's still a continuous function if we consider its domain.
A question regarding continuity: is this or that function continuous? Are we talking about the whole set of all real numbers or just its domain (a subset of all reals)? This question arises quite often because when we say that a function is continuous is not exactly the same thing as to say that the function does not have any discontinuities. Take that example above of a function that is discontinuous everywhere. In that specific case, to say that it's not continuous is a synonym.