Does $\lim_{k\to\infty} \sum_{n=1}^{k} f(n)$ converge? I am wondering if there is a rigourous way to show the following series converges:
$$ f(x) = \begin{cases}
\dfrac{1}{x^2} &amp; x \in \mathbb{N} \\[1ex]
g(x) &amp; x \not\in \mathbb{N}\in \mathbb{R}
\end{cases}$$
Here, $g(x)$ could be anything, but for interest, wouldn't converge on its own.
When we do the following:
$$\lim_{k\to\infty}\sum_{n=1}^{k}f(n).$$
Do we get a limit that exists?
Intuitively we would, because summation is only defined on the natural numbers (unless we redefined it here, doing some interpolation between points). However, I am not certain this function is integrable, which would suggest the function does not converge (unless my understanding of the Integral Test is wrong, after all, it says nothing of whether the integral exists, just if it converges the sum converges and vice-versa).
To address your confusion, we note that the integral test requires that $f(x)$ must be monotone decreasing over the interval $\left[1, \infty\right)$ to be applicable.
Check this link: https://en.wikipedia.org/wiki/Integral_test_for_convergence
Hence, if we have
$$f(n) = \frac{1}{n^2}$$
for all $n \in \mathbb{N}$, and you want to extend it to $\mathbb{R}$ by setting $f(x) = g(x)$ for all $x \in \mathbb{R} \setminus \mathbb{N}$, then you have to make sure that the selection of $g(x)$ keeps $f(x)$ monotone decreasing over the interval $\left[1, \infty\right)$ so that the integral test can kick in.
If the ultimate goal of extending $f(n)$ to the domain $\mathbb{R}$ as $f(x)$ is to hopefully construct $f(x)$ so that we can use the integral test to prove that the series
$$\sum_{n = 1}^{\infty} f(n) = \lim_{k \to \infty} \sum_{n = 1}^{k} f(n)$$
converges, then in this case, the way you extend $f(n)$ to $f(x)$ matters. If you can prove that there exists at least one way to extend $f(n)$ to $f(x)$ such that $f(x)$ is monotone decreasing over the interval $\left[1, \infty\right)$, then this is sufficient to invoke the integral test to prove that
$$\sum_{n = 1}^{\infty} f(n) &lt; \infty$$
For instance, you can trivially take $g(x) = 1/x^2$ for $x \in \mathbb{R} \setminus \mathbb{N}$ so we have $f(x) = x^2$ for all $x \in \mathbb{R}$ which is monotone decreasing.
But if you just just want to know if the limit exists, then you can do so without extending $f(n)$ to $\mathbb{R}$. I mean, you can do so without invoking the integral test. Evaluating this sum is known as the Basel problem and the result is $\pi^2/6$.
Check this link: https://en.wikipedia.org/wiki/Basel_problem
About the series,
$$\sum_{n\ge 1} f(n)=\sum_{n\ge 1}\frac{1}{n^2}$$
converges as a Riemann series $(2&gt;1)$.
As an integral, we can say nothing. It depends on the expression of $ f(x).$
Take for example $ f(x)=1$ if $ x\notin \Bbb N$, then
$$\int_1^{+\infty}f(x)dx \;\; diverges$$
and If $$(\forall x\ge 1)\;\; f(x)=\frac{1}{x^2}\; $$
the integral $$\int_1^{+\infty}f(x)dx\;\; converges$$