Proof by contradiction. Let's assume that for every $M$ and $\epsilon$ there exist $x\in[0,\epsilon]$ such that $|f(x)| \ge M x$. In particular that means that for every $n\in\mathbb{N}$ there exist $x_n\in[0,\frac{1}{n^2}]$ such that $|f(x_n)| \ge nx_n$.
Let us divide sequence $x_n$ into two subsequences, one for which $f(x_n)>0$ and the other for which $f(x_n)<0$. One of these two subsewuences is guaranteed to be infinite; without a loss of generality we can assume it's the former, i.e. there exists an infinite growing sequence $n(k)$, $k\in\mathbb{N}$ such that $0 < x_{n(k)} < \frac{1}{n(k)^2}$, $f(x_{n(k)})>n(k)x_{n(k)}$. Obviously, it also satisfies $n(k) \ge k$.
Let us construct a seqence $a_n$ in the form $$x_{n(1)}, \dots x_{n(1)}, x_{n(2)}, \dots x_{n(2)}, x_{n(3)}, \dots x_{n(3)}, x_{n(4)}, \dots x_{n(4)}, x_{n(5)}, \dots $$
where number $m_k$ of copies of $x_{n(k)}$ is such that
$$ \frac{1}{k^2} < m_k x_{n(k)} < \frac{2}{k^2}$$
Since $0 < x_{n(k)} < \frac{1}{n(k)^2} \le \frac{1}{k^2}$, there's a guarantee that such $m_k$ exists.
We have $$\sum_{n=1}^\infty a_n = \sum_{k=1}^\infty m_k x_{n(k)} < \sum_{k=1}^\infty \frac{2}{k^2} $$
so $\sum a_n$ is convergent. However, because $f(x_{n(k)})> n(k)x_{n(k)} \ge kx_{n(k)}$ we have
$$ \sum_{n=1}^\infty f(a_n) = \sum_{k=1}^\infty m_k f(x_{n(k)}) > \sum_{k=1}^\infty m_k k x_{n(k)} > \sum_{k=1}^\infty \frac{1}{k}$$
So $\sum_n f(a_n)$ is not convergent. The contradiction proves he theorem.