"Sequence language" translated into "function language" 
Given a positive sequence $(a_n)$ which satisfies $\displaystyle \sum_{n=1}^{\infty}\frac{1}{a_n}$ converges. Let $S_n=a_1+a_2+\cdots+a_n$. 
  Prove that $\displaystyle \sum_{n=1}^{\infty} \frac{n^2a_n}{S_n^2}$ also converges.

This is the first part of the solution: 
Translate the hypothesis into function language: if $f:\mathbb{R}^+\rightarrow \mathbb{R}^+$ is an increasing function and $\displaystyle \int_{0}^{\infty}\frac{dx}{f(x)}$ converges, then $\displaystyle \int_{0}^{\infty} \frac{x^2f(x)}{F^2(x)}dx$ also converges, where $F(x)$ is the anti-derivative of $f(x)$.
I don't understand this. What is the function $f(x)$? And why $S_n$ can be also understood as $F(x)$? 
Thanks a lot.
 A: If $f:\mathbb R^+\to\mathbb R^+$ is given, then
\begin{align*}
\sum_{n=1}^\infty\inf_{x\in(n-1,n)}f(x)\leq\sum_{n=1}^\infty\int_{n-1}^nf(x)dx=\int_0^\infty f(x)dx=\sum_{n=1}^\infty\int_{n-1}^nf(x)dx\leq\sum_{n=1}^\infty\sup_{x\in(n-1,n)}f(x),
\end{align*}
so the integral converges if the right sum converges, and if the integral converges, then so does the left sum. If we define $f(x):=a_n$ for $x\in(n-1,n),n\in\mathbb N$, then we have equality in the above inequalities. Moreover, $F(x):=\int_0^xf(t)dt$ is piecewise linear and $F'(x)=f(x)$ for $x\in(n-1,n),n\in\mathbb N$, and
\begin{align*}
F(n)=\int_0^{n}f(t)dt=\sum_{k=1}^{n}\int_{k-1}^kf(t)dt=\sum_{k=1}^{n}a_k=S_n.
\end{align*}
Now, if one proves that
\begin{align*}
\int_0^\infty\frac{x^2f(x)}{F(x)^2}dx
\end{align*}
converges, then the above considerations show that the series
\begin{align*}
\sum_{n=1}^\infty\inf_{x\in(n-1,n)}\frac{x^2f(x)}{F(x)^2}
\end{align*}
converges. Due to
\begin{align*}
\sum_{n=1}^\infty\frac{n^2a_n}{S_n^2}\leq\sum_{n=1}^\infty\inf_{x\in(n-1,n)}\frac{x^2f(x)}{F(x)^2},
\end{align*}
the left series also converges.
A: 
What is the function $f(x)$?

The function $f(x)$ can be understood as some function, that is equal to $a_k$ when $x=k$ for all natural $k$. Such a funtion is introduced since integrals and other tools of calculus are better suited towards real-valued functions rather than integer sequences (e.g. it is trivial to integrate $g(x)=x^2$ but not so obvious what to do if we are to integrate a sequence $a_k=k^2$), thus we define some real valued function $f(x)$ such that $a_k=f(k)$ for all natural $k$. Note that we need not explicitly find a expression for this function.

Why $S_n$ can be also understood as $F(x)$

This ir related to growth rates, see, $f(x)$ is the derivative of $F(x)$, so $F(x)$ growth rate is precisely $f(x)$. Now notice that $S_{k}$ inreases by $a_{k}$ each "step" (in other words $S_{k}-S_{k-1}=a_{k}$). So $a_{k}$ can be interpreted as the growth rate of  $S_k$. Since $f(x)$ and $a_k$ are connected, and since both are growth rates of $F(x)$ and $S_k$ appropriately, then it follows that $S_n$ and $F(x)$ are also connected. 
