Since this question has been closed as a duplicate of this one, I will only assume, as in the other question, that $f$ is injective, and show that the series must diverge. In doubt, I will also assume $\mathbb{N} = \{0, 1, 2, \dots\}$.
Let $S_N = \sum_{n=1}^N \frac{f(n)}{n^2}$. The sum $S_N$ assigns nonnegative "weights" $f(1)$, $f(2)$,... , $f(N)$, to the numbers $\frac{1}{1^2}$, $\frac{1}{2^2}$, ....,$\frac{1}{N^2}$, in that order, and takes the sum.
Now say we would like to make the sum defining $S_N$ as small as possible by rearranging the weights. It is clear that to do this the largest weights must be assigned to the smallest numbers. Therefore if the weights $f(1)$, $f(2)$, ..., $f(N)$, are arranged in increasing order as $a_1$, $a_2$, ..., $a_N$, we must have the inequality
$$S_N \geq \sum_{n=1}^N \frac{a_n}{n^2}.$$
Because $f$ is assumed injective, it is easy to show by induction that $a_n \geq n - 1$. Thus the partial sums $S_N$ satisfy the inequality
$$S_N \geq \sum_{n=1}^N \frac{n-1}{n^2}.$$
Therefore the series diverges by comparison with, for instance, $\sum_2^{+\infty} \frac{1}{2n}$