I stumbled upon this question from a calculus exam:
Let $f \in C^1(\mathbb{R})$ be monotonically decreasing such that $\lim \limits_{x \rightarrow \infty} f(x) = 0$. Prove that $$\lim \limits_{n \rightarrow \infty} n \sum \limits_{j=1}^{n} \frac{\cos(\frac{n}{j})f(\frac{n}{j})}{j^2}$$ exists and is finite.
Now, obviously the solution the writers of this problem had intended was to look at the integral $$\int \limits_{0}^{1} \frac{\cos(\frac{1}{x})f(\frac{1}{x})}{x^2}dx = \int \limits_{1}^{\infty} f(x)\cos x \, dx,$$ which converges by the Dirichlet criterion. Then the Riemann sums attributed to the partitions $\Pi_n = \{0, \frac{1}{n}, \frac{2}{n}, ..., 1 \}$ are $S_n=n \sum \limits_{j=1}^{n} \frac{\cos(\frac{n}{j})f(\frac{n}{j})}{j^2}$, which would imply $$\lim \limits_{n \rightarrow \infty} n \sum \limits_{j=1}^{n} \frac{\cos(\frac{n}{j})f(\frac{n}{j})}{j^2}=\int \limits_{0}^{1} \frac{\cos(\frac{1}{x})f(\frac{1}{x})}{x^2}dx < \infty,$$ if the function $\cos(\frac{1}{x})f(\frac{1}{x})x^{-2}$ was Riemann-integrable on $[0,1]$.
The problem with that approach, however, is that the integral $$\int \limits_{0}^{1}\frac{\cos(\frac{1}{x})f(\frac{1}{x})}{x^2}dx$$ is not a Riemann-integral but an improper-integral so one cannot conclude that $$\lim \limits_{n \rightarrow \infty} S_n = \int \limits_{0}^{1}\frac{\cos(\frac{1}{x})f(\frac{1}{x})}{x^2}dx$$
After many hours of thinking trying to resolve this issue, I realized that the question may be false as it makes no sense that the limit exists because that would sort of mean that the integral is a proper Riemann-integral which would imply the function is bounded (which is not necessarily true depending on the choice of $f$). To test this, I used Wolfram Alpha to calculate numerical estimates with the function $f(x)=\frac{1}{x}$, which confirmed my speculations, though I have not been able to rigorously prove it.
My question is can you find an example that disproves the claim the question makes? Or was I wrong and the claim can be proven?