# Prove uniform convergence for piecewise function

I have the following problem. For each positive integer $$n$$, let $$f_n: [0, 2] \rightarrow \mathbb{R}$$ defined by $$f_n(x) = \begin{cases} nx & \text{if 0 \le x \le\frac{1}{n}} \\ 1 & \text{if \frac{1}{n} < x \le 2} \end{cases}$$ Let $$f: [0, 2] \rightarrow \mathbb{R}$$ defined by $$f(x) = 0$$ for all $$x \in (0, 2]$$. Prove that $$\langle f_n \rangle_{n = 1}^\infty$$ does not converge uniformly to $$f$$ by negating the definition of uniform convergence. I guess the negation is that there exists an $$\epsilon > 0$$, an $$x \in [0, 2]$$ and an positive integer $$n$$ such that $$\lVert f_n - f \rVert = \sup \Big \{ \lvert f_n (x) - f(x) \rvert: x \in [0, 2] \Big \} \ge \epsilon$$. I am not sure if I am negating correctly.

At the same time, I notice that if $$\frac{1}{n} < x \le 2$$, $$\langle f_n \rangle_{n = 1}^\infty$$ does not converge pointwise to $$f$$, so it cannot converge uniformly to $$f$$. I am a little bit stuck when $$0 ] \le x \le \frac{1}{n}$$. I am not sure if I am doing things right because it seems like I am not using the negation at all. Please help me if you can. Thank you so much.

Given any $$x\in (0,2]$$, there exists $$N$$ such that $$\frac 1n\lt x$$ for all $$n\ge N$$. It follows that for $$n\ge N, f_n(x)=1$$ and so $$f_n(x)\to 1$$ but $$f_n(0)\to 0$$.
Let $$n$$ be any positive integer. $$\|f_n-f\|\geq |f_n(\frac 1 n) -f(\frac 1 n)|$$ since the supremeum of a set is greater than or equal to each element of the set. Hence $$\|f_n-f\|\geq |1-0|=1$$ which shows that $$f_n$$ does not converge to $$f$$ uniformly.