Further below shows convergence of $\sum_{n=1}^{\infty}\frac{a_n}{f(n)}$ is guaranteed if the $a_n$s are nonincreasing. This just below was my original answer however which did not assume the $a_n$ are nonincreasing. This shows that the $a_n$s nondecreasing is essential to guarantee that the sum $\sum_{n=1}^{\infty}\frac{a_n}{f(n)}$ converges. What about $a_n$ defined as follows: $a_n = n$ if $3$ does not divide $n$, and $a_n = 0$ otherwise, or equivalently, if $n$ is a multiple of $3$. Then define $f(n) = 3n$.
Then on the one hand, $\sum_{n=1}^{\infty} \frac{a_n}{f(n)}$ diverges; $\frac{a_n}{f(n)}$ is nonnegative for all $n$ and is $\frac{1}{3}$ for each $n$ that is not divisible by $3$ and there are an infnite number of such $n$. On the other hand, $\sum_{n=1}^{\infty} a_{|f(n)|}$ is $0$ as $f(n)$ is a multiple of $3$ for all $n$ and $a_m$ is $0$ for all $m$ that is a multiple of $3$.
ETA: Here we show that if the $a_n$s are also nonincreasing, then convergence of the infinite sum $\sum_{n=1}^{\infty}\frac{a_n}{f(n)}$ is guaranteed.
IF however the $a_n$ are nonincreasing it is a different story:
THM 1. Let $\{a_n\}; n=1,2,\ldots$ be a nonincreasing sequence of positive numbers, and let $\{f(n)\}; n=1,2,\ldots$ be a sequence of positive integers such that $\lim_{n \rightarrow \infty} f(n)$ is $\infty$. Furthermore, suppose that $\sum_{n=1}^{\infty} a_{f(n)}$ is finite. Then $\sum_{n=1}^{\infty} \frac{a_n}{f(n)}$ is also finite.
We now note that we do not assume anything else about $f$; in particular $f$ is not assumed to be increasing nor injective.
To prove THM 1, let $A$ be the set $A=\{n; f(n)>n\}$ and let $B$ be the remaining set of integers, or equivalently, $B=\{n; f(n)\le n\}$. We now establish the following result:
Lemma 2. Let us assume the conditions of THM 1. Then $\sum_{n \in B} \frac{a_n}{f(n)}$ is finite.
Proof of Lemma 2:
$$\sum_{n \in B} \frac{a_n}{f(n)} \le \sum_{n \in B} \frac{a_{f(n)}}{f(n)}$$
$$\le \sum_{n \in B} a_{f(n)},$$
the first inequality following from the $a_i$s nonincreasing in $i$ and $f(n)\le n$ for each $n \in B$.■
Remainder of Proof of THM 1: To finish the proof of THM 1, note that it suffices to show that $\sum_{n \in A} \frac{a_n}{f(n)}$ is finite. We do so next.
First, let $F$ be the set of integers $k$ such that there is at least one $n$ such that $f(n)=k$. Then write $F =\{k_1,k_2,\ldots \}$ where the $k_i$s are in increasing order, and if $k_1>1$, define an additional integer $k_0=1$. Then the conditions of THM 1 give
$$\sum_{i=0}^{\infty} a_{k_i} \le a_1+ \sum_{n=1}^{\infty} a_{f(n)} < \infty.$$
Also, for each nonnegative integer $i$:
$$a_{k_i} \ge \sum_{n=k_i}^{n=k_{i+1}-1} \frac{a_n}{k_{i+1}-k_i}$$
$$\ge \sum_{n=k_i}^{n=k_{i+1}-1}\frac{a_n}{k_{i+1}}.$$ [The first inequality follows from the $a_n$s nonincreasing.] Thus the following inequality is true:
$$\sum_{i=0}^{\infty}\sum_{n=k_i}^{n=k_{i+1}-1} \frac{a_n}{k_{i+1}}$$
$$\le \sum_{i=0}^{\infty} a_{k_i} < \infty.$$
Now, let $n$ be an integer in $A$, and let $i$ be a nonnegative integer such that $k_i \le n < k_{i+1}$. Then $f(n)>n$ [because $n \in A$] and so $f(n) \ge k_{i+1}$ and thus the inequality $\frac{a_n}{f(n)}\le \frac{a_n}{k_{i+1}}$ holds for that particular $n$. So equivalently, now let $i$ be a nonnegative integer and define a subset $A_i$ of $A$ as follows: $A_i =\{n \in A;$ $k_i \le n$ $<k_{i+1}\}$. Then the $A_i$s partition $A$, and for each nonnegative integer $i$ and each $n \in A_i$ the inequality $\frac{a_n}{f(n)}\le \frac{a_n}{k_{i+1}}$ holds. Thus from this observation:
$$\sum_{n \in A} \frac{a_n}{f(n)} = \sum_{i=0}^{\infty}\sum_{n \in A_i} \frac{a_n}{f(n)}$$
$$\le \sum_{i=0}^{\infty}\sum_{n\in A_i}\frac{a_n}{k_{i+1}}$$
$$\le \sum_{i=0}^{\infty}\sum_{n=k_i}^{k_{i+1}-1}\frac{a_n}{k_{i+1}}$$ $$\le \sum_{i=0}^{\infty} a_{k_i}<\infty.$$
Thus indeed the inequality $\sum_{n \in A}\frac{a_n}{f(n)}$ $<\infty$ holds and so THM 1 follows. ■