Explanation of $\overline{\lim} A_n$ and $\underline{\lim}A_n$ Let $(A_n)_n$ be a countable family of subsets of a set $X$. We define:
$$\lim \inf A_n = \underline{\lim} A_n = \bigcup_{n \in \mathbb N} \bigcap_{k \ge n} A_k$$
$$\lim \sup A_n = \overline{\lim} A_n = \bigcap_{n \in \mathbb N} \bigcup_{k \ge n} A_k$$
I don't quite understand what is meant by these notions.
I'm studying measure theory, and this is part of the preliminaries section. The author only mentions the definitions with no further explanation or examples. 
I would appreciate some explanation and perhaps an example or two.
Thank you. 
 A: What does $$x\in \bigcup_{n \in \mathbb N} \bigcap_{k \geq n} A_k$$ mean? It means that there exists some $n\in\mathbb N$ such that $x\in \bigcap_{k\geq n} A_k$, which is the same as saying that $x\in A_k$ for all $k\geq n$. That is, $x$ is contained eventually in all of $A_n$, $A_{n+1}$, $A_{n+2}$, etc. In other words, $x$ is contained in $A_k$ for all but finitely many $k$.

What does $$x\in \bigcap_{n \in \mathbb N} \bigcup_{k \geq n} A_k$$ mean? It means that for all $n\in\mathbb N$, it is true that $x\in\bigcup_{k\geq n} A_k$, which is the same as saying that for any fixed $n$ there exists some $k\geq n$ such that $x\in A_k$. That is, no matter how large you choose $n$, you can always find some $k\geq n$ such that $x\in A_k$. In other words, $x$ is contained in $A_k$ for infinitely many $k$.

Note that $\liminf A_n\subseteq\limsup A_n$, because if $x\in A_k$ in all but finitely many $k$, then $x\in A_n\cap A_{n+1}\cap A_{n+2}\cap\ldots$ for some $n\in\mathbb N$ sufficiently large, so $x$ is a fortiori contained in infinitely many of the sets. The inclusion can  be strict—see immediately below.

Here is a simple example: let
\begin{align*}
A_1\equiv&\,\text{set of positive odd numbers},\\
A_2\equiv&\,\text{set of positive even numbers},\\
A_3\equiv&\,\text{set of positive odd numbers},\\
A_4\equiv&\,\text{set of positive even numbers},
\end{align*}
and so forth. One can see that no natural number can be contained in $A_k$ for all but finitely many $k\in\mathbb N$, because every positive integer is not contained in “half” of the sets. This is implies that $\liminf A_n=\varnothing$. On the other hand, every positive integer is contained in every other set; in particular, every positive whole number is contained in $A_k$ for infinitely many $k\in\mathbb N$. Hence, $\limsup A_n=\mathbb N$.
A: Warning: this is more of a picture of the idea, rather than mathematically rigorous explanation.
The two limits are basically defining a candidate "limit set" by giving a bound from outside or inside. 
The lim sup is considering big union of sets, namely $\bigcup_{k \ge n} A_k$, and by taking intersections over $n$, we are throwing away stuff that appears only in finitely many $A_k$. If something appears in infinitely many $A_k$, it is a plausible candidate to be an element of a "limit set".
The lim inf works the other way around: we first select elements that, for $k\geq n$, appear in every $A_k$, that is $\bigcap_{k \ge n} A_k$. Those are definitely good candidates for a "limit set". Then we consider the union of all these intersections.
These two limits are good bounds for a candidate "limit set". On one hand, if $x$ is not in the limsup, then it means that $x$ is contained in only finitely many $A_n$, so it cannot belong to a reasonable "limit set"; the limsup is an "outer bound". On the other hand, anything that is contained in every set (except possibly finitely many) should probably be also in the "limit set"; the liminf is therefore an "inner bound".
To give an example, consider this sequence of sets:
$$
A_n = \begin{cases}
[0,1/2)\quad \mbox{if n is odd}\\
[1/2,1]\quad \mbox{if n is even}\\
\end{cases}
$$
Since $A_n\cap A_{n+1}=\emptyset$, the liminf is the empty set. Makes sense: there's no element that is contained in every set (for $n$ large enough). The limsup on the other hand is $[0,1]$, since every element in it keeps appearing in the sequence.
A: $x\in \lim\inf A_n$ if $x$ is in all the $A_n$ from some point onward.  That is, if there exists $j\in \mathbb{N}$ such that $x\in A_k$ for all $k\ge j$.
And $x\in \lim\sup A_n$ if $x$ is an element of infinitely many of the $A_n$'s.
A: Well, you can consider the sequence of functions $g_k = 1_{A_k}$.
If $\omega \in \cup_n \cap_{k>n} A_k$ the for some $n$ $\omega$ is in every set $A_k$ $k>n$ this means that $g(\omega) \leq \liminf g_k(\omega)$ on the other hand  if $g(\omega) = \liminf g_k(\omega) = 1$ then $\omega$ fails to be in $A_k$ only a finite time and so you see that $$g(\omega) = 1_{\cup_n \cap_{k>n} A_k}$$
define $h (\omega) = \limsup g_k$ then you see that $h(\omega) = 1$ if and only if $\omega \in A_k$ infinitely often. wich means that for every $n$  there is a $k$ larger than $n$ such that $\omega \in A_k$
this means that $\omega \in \cap_n \cup_{k>n} A_k$
$$h(\omega) = 1_{\cap_n \cup_{k>n} A_k}$$
for an example, consider the sets $A_k = (0,k)$ if $k$ is even and $(-k,1)$ if $k$ is odd. 
Then $ \cup_n \cap_{k>n} A_k = \emptyset$ whereas $\cap_n \cup_{k>n} A_k = \mathbb{R}$
