An example where Egorov's theorem fails 
This is p.62 of Folland Real Analysis book. Here the measure of X is supposed to be finite. But, I want to know the case in which the theorem doesn't work if X is of infinite measure. I tried to think of one myself, but have failed..
Could anyone show me some example?
 A: Take $f_n=\chi_{[n,n+1]}$ with Lebesgue measure on $\mathbb{R}$. 
A: Let $X=\mathbb R$ and $f_n(x)=x/n$ for each $x\in\mathbb R$ and $n\in\mathbb N$. Then, $f_n\to 0$ pointwise. Now, if the conclusion of Egoroff's theorem were true, then for any fixed $\varepsilon>0$ there would exist some Borel set $E\subseteq\mathbb R$ such that $\mu(E)<\varepsilon$ ($\mu$ is the Lebesgue measure) and $f_n\to 0$ uniformly on $E^c$. This clearly entails that $\mu(E^c)=\infty$. Furthermore, by uniform convergence, for a fixed $\xi>0$, there exists some $N\in\mathbb N$ such that $n\geq N$ and $x\in E^c$ together imply that $|x/n|<\xi$. In particular, $|x|< \xi N$, so that $E^c\subseteq(-\xi N,\xi N)$, which is of finite measure–a contradiction.

Note, however, that by Exercise 2.40, the hypothesis of $\mu(X)<\infty$ can be replaced by the requirement that $(f_n)_{n\in\mathbb N}$ be pointwise dominated in absolutely value by some integrable function.
A: The following is a more elementary example.
Let $(X, S, \mu)$ be a measure space where $X=\mathbb{N}$, $S=2^{\mathbb{N}}$ and $\mu$ is the counting measure i.e. for $E\in S$
$$\mu(E)= \begin{cases}n, & \text{if $E$ contains exactly $n$ elements} \\ \infty, & \text{if $E$ is not finite}\end{cases}.$$
Now define $$f(x) = 1, \quad \text{ for all } x \in X$$ and $$f_n(x) = \begin{cases} 1, & \text{ if } x < n \\ 0, & \text{ otherwise }\end{cases}$$.
Clearly, $f_1, f_2, \dots$ converges pointswise to $f$ on $X$, but not uniformly.
Suppose that there exists $E \in S$ such that $f_1, f_2, \dots$ converges uniformly to $f$ on $E$ and $\mu(X\setminus E)=0$. By definition of $\mu$, $$X\setminus E = \emptyset.$$ Thus, since $E \subset X$, $$E = X.$$ However, $f_1, f_2 \dots$ does not converge uniformly to $f$ on $X$. Therefore, such $E$ does not exist.
