To show function converges to a continuous function but not uniformly Let
$$f_n(x) =
\begin{cases}
0,  & \text{if } x<\frac{1}{n+1} \\
\sin \frac{\pi}{x}, & \text{if } \frac{1}{n+1}\le x\le\frac{1}{n} \\
0, & \text{if } x>\frac{1}{n}.
\end{cases}$$
Show that $f_n(x)$ converges to a continuous function but not uniformly.
I do not know how to proceed with this. Any help/hint would be appreciated.
 A: We show that $f_n\to 0$ pointwise, but not uniformly.
Suppose $x\in\mathbb{R}$. If $x\leq 0$ then $f_n(x)=0$ for all $n$. If $x>0$, we can choose $N\in\mathbb{N}$ such that $1/N<x$. In this case, we have $f_n(x)=0$ for all $n\geq N$. Therefore $f_n(x)\to0$ for all $x\in\mathbb{R}$, which means that $f_n\to 0$ pointwise.
To see that $f_n\not\to0$ uniformly, note that for every $n\in\mathbb{N}$, we have
$$
\sup_{x\in\mathbb{R}} |f_n(x)| = 1.
$$
Indeed, fix $n\in\mathbb{N}$ and take $x:=\frac{1}{n+1/2}$. Then $x$ satisfies $1/(n+1) \leq x \leq 1/n$, and so
$$
|f_n(x)| = |\sin\left(\frac{\pi}{x}\right)| = |\sin(n\pi+\pi/2)| = 1.
$$
A: $f_n$ converges pointwise to the constant function $f(x) = 0$.
The definition of what it means for $f_n$ to converge uniformly to $f$ is as follows: for any $\epsilon > 0$, there exists an $N \in \mathbb{N}$ such that for all $n \geq N$, and all $x \in \mathbb{R}$, we have $|f_n(x)| < \epsilon$.
Therefore, to say that the convergence is not uniform is to say that there exists an $\epsilon > 0$ such that for any $N \in \mathbb{N}$, there exists an $n \geq N$ and an $x \in \mathbb{R}$ such that $|f_n(x)| \geq \epsilon$.
Look at the graph of $y = \sin(\pi/x)$ near the point $x = 0$ on the right side.  Try working with $\epsilon = 1$.  The rapid oscillation between $-1$ and $1$ should give you an idea of how to proceed.
