I recently came across this one:
A function which is continuous and positive for $x \geq 1$ and such that $\int_1^\infty f(x)\;dx$ diverges and $\sum_{1}^\infty f(n)$ converges
I understand what the function $g$ is .
My questions are:
- Is there anything special about the function $g$ here?
- Why define $f$ by adding $g$ to $\frac{1}{x^2}$ ?
- Why $f$ is continuous?
- Is there any other simple functions $g$ instead of the given one to make $f$ easier?
For my second question, I think we know $\sum \frac{1}{n^2} < \infty $ and $g(n)=0$ for integer points. So we define like this. Is this correct?
For my third question, I think $g$ is continuous and $\frac{1}{x^2}$ is continuous, so their sum is continuous. Is there any reason apart from this?
Any help must be appreciated and thanks in advance!

Let consider for example
$$g(x)=\sin^2(2\pi x) \implies g(n)=\sin^2 (2\pi n)=0\quad \forall n$$
The $1/x^2$ term has been added in order to have $f(n)>0$.
The continuity was considered in order to exclude simple example for $f$ as for example $f(x)=1$ $\forall x\not \in \mathbb{Z}$ and $f(x)=1/x^2$ otherwise.