When does $f_n(x) = a_n \times (1 - nx)$ converge uniformly? The sequence of functions $\{f_n\}_n$ is defined on $[0,1]$ by:
$$f_n(x) = a_n \times (1 - nx),\ {\rm\ if}\ x \in  ]0,\frac{1}{n}],$$ and $f_n(x) = 0$ otherwise, where $(a_n)_n$ is a positive sequence of real numbers.

Q: How can we choose the sequence $(a_n)$ so that $\{f_n\}_n$ converges uniformly to $0$ on $[0,1]$?

Attempt:
It's easy to verify that $\{f_n\}$ converges pointwise to $0$ on $[0,1]$. Now let $n \in \mathbb N$ be given and let's study the behaviour of $f_n$. For $x \notin ]0, \frac{1}{n}]$, there's nothing to study. So let $x \in ]0, \frac{1}{n}]$. We have $f'_n(x) = -n \times a_n \le 0$, for all $x$, so $f_n$ is decreasing. And eventually, $$\sup_{x \in ]0, \frac{1}{n}]} |f_n(x)| = \lim_{x \to 0} f_n(x)$$
To have uniform convergence, we should have that quantity convergent to $0$. As $\lim_{x \to 0} f_n(x) = a_n$, we should then have $a_n$ convergent to $0$.
Is there something missing? Does this fully answer the question? 
Thanks.
 A: Your solution is correct but it is very specific to this problem. In general what you can do is as follows.
Here is another way to view uniform convergence. Let $\{f_n\}$ be a sequence of functions defined on a set $E$. If $\{f_n\}$ converges uniformly to $0$ on $E$, then given $\epsilon >0$ there exists $N$ such that 
\begin{align*}
|f_n(x)| < \epsilon & & (n\geq N; x \in E).
\end{align*}
This implies
\begin{align*}
\sup_{x\in E}|f_n(x)| \leq \epsilon & & (n\geq N).
\end{align*}
Hence if $\{f_n\}$ converges uniformly to $0$ on $E$, then
\begin{align}
\lim_\limits{n\to \infty}\sup_{x\in E}|f_n(x)| = 0. & & (1)
\end{align}
Conversely, it is not difficult to show that if $(1)$ holds then $\{f_n\}$ converges uniformly to $0$ on $E$.
Since you have already noticed that $\{f_n\}$ converges pointwise to the $0$ function. Now by the above observation the convergence is uniform if and only if 
\begin{align}
\lim_\limits{n\to \infty}\sup_{x\in E}|f_n(x)|= \lim_\limits{n\to \infty}a_n = 0
\end{align}
