Consider the function $f_n(x)$ defined on closed interval $[-2,2]$ by
$$f_n(x) = \begin{cases} 1 &\text{if}\quad |x| \geq \frac{1}{n}\\ n|x| &\text{if}\quad |x|\lt \frac{1}{n}\end{cases}$$
This sequence of function converges pointwise to constant function 1. Each of $f_n$ as well as $f$ is continuous and for any $x$ the sequence $f_n(x)$ is monotonically increasing, still the convergence is not uniform. But, I have been asked in a book to prove the above lemma whereas I have found a counterexample. Where am I wrong ?