Sequence converging to $0$ - two variable function For $n\in\mathbb{N}$ define $g_n:[0,2]\rightarrow\mathbb{R}$ by
$$g_n(x)= \begin{cases} n^2x \ &\text{if } 0\le x<\frac{1}{n} \\
2n-n^2x\ &\text{if } \frac{1}{n}\le x<\frac{2}{n} \\
0\ &\text{if } \frac{2}{n}\le x\le 2 \end{cases} \text{.}$$
Show that for any $x\in [0,2], g_n(x)\rightarrow 0$ as $n\rightarrow\infty$.
I honestly had no idea what to do here. For the first part, I tried a sequences approach: $n^2x\rightarrow 0$ as $n\rightarrow\infty$ if for all $\varepsilon>0$ there is some $N_{\varepsilon}\in\mathbb{N}$ such that for any $n>N_{\varepsilon}$ we have $|n^2x|<\varepsilon$. If we choose $N_{\varepsilon}=\sqrt{n\varepsilon}$ then we have the required result. But this doesn't help really as it doesn't include the fact that $0\le x<\frac{1}{n}$. Any ideas?

I assume that this is pointwise convergence and not uniform convergences (as that would be wrong).
The key is that the interval on which $g_n(x)=n^2x$ will become infinitely small. More mathematical:
Take some $\varepsilon>0$. We want to show that for every $x\in[0,2]$ there exists a $N\in\mathbb{N}$ s.t. $\forall n\geq N$: $g_n(x) < \varepsilon$.
For arbitrary $x$ we choose $N = \frac{2}{x}+1$ as we then get $x = \frac{2}{N-1}$ and for $n\geq N$ we have $\frac{2}{n} < \frac{2}{N-1}=x$ and therefore we always get $g_n(x)=0$.
Uniform convergence is not given as for every $\varepsilon>0$ and every $N\in\mathbb{N}$ we can take $x=\frac{\varepsilon}{N}$ and get $g_n(x)=n^2 \cdot \frac{\varepsilon}{N} \geq N^2 \cdot \frac{\varepsilon}{N} = \varepsilon N > \varepsilon$ for all $n\geq N$.
