This answer is to show (as requested by the OP in a comment) that, if $f$ is assumed to be monotone decreasing, then in fact the equality holds between the integral and the limit of the sum. First note we may assume $f(x)>0$ on $(0,1]$ since adding a constant to $f$ adds the same constant to both the integral and to each of the sums. (This assumption might be avoided, but makes the proof run smoother at a certain point.)
Because $f$ is decreasing on $[1/n,1]$ a diagram shows that
$$(1/n)\sum_{k=2}^n f(k/n) \le \int_{1/n}^1 f(x) dx \le (1/n)\sum_{k=1}^{n-1} f(k/n).$$
(The left side is the area of rectangles underneath $f$, while the right side is the area of rectangles containing the area under $f$.) Define $A_n=\int_0^{1/n}f(n),$ and note that the assumption that $\int_0^1 f(x)dx$ is finite means that $A_n \to 0$ as $n \to \infty.$ We now add $A_n$ to all three terms, at the same time adding and subtracting a term to the two sums so as to compare them to $S_n=(1/n)\sum_{k=1}^nf(k/n),$ obtaining
$$ A_n+S_n-(1/n)f(1/n) \le \int_0^1 f(x)dx \le A_n+S_n-(1/n)f(1).$$ Using $I$ for the value of the integral in the middle here, we may rearrange to obtain bounds on $S_n$ as
$$I-A_n+(1/n)f(1) \le S_n \le I - A_n + (1/n)f(1/n). \tag{1}$$
Note here that the left term of this inequality is smaller than the right since $f$ is monotone decreasing; if we show that each side approaches $I$ then our proof finishes via the "sandwich theorem".
It's clear the left side of (1) tends to $I$, and since $A_n$ tends to $0$ we are left with showing that $(1/n)f(1/n) \to 0$ as $n \to \infty$ But since $f$ is monotone decreasing the term $(1/n)f(1/n)$ is the area of a rectangle lying below $f$ on the interval $[0,1/n]$, so that in fact $(1/n)f(1/n) \le A_n$, and the latter approaches $0$ as $n \to \infty.$ This finishes the proof on use of the sandwich theorem as mentioned above.
NOTE: Peter Tamaroff's answer references a proof by Polya and Szego of the result without the extra assumption $xf(x)$ monotone decreasing, which I had made in a previous version. The now adjusted form of the argument here is essentially the same as the Polya/Szego proof.