How can I prove that $f(x)=\sum_{k=1}^{\infty}\frac{\{kx\}}{k^{2}}$ is continuous? Let $f:\mathbb{R}\to\mathbb{R}$ be defined as $$f(x)=\sum_{k=1}^{\infty}\frac{\{kx\}}{k^{2}},$$ where $$\{x\}=\begin{cases}0; & x = \dfrac{n}{2}\ \text{for some odd integer } n\\x - m(x);& \text{otherwise}\end{cases}$$ and $m(x)$ is the nearest integer to $x$.
I have already proved that $f$ is continuos at $x=0$ (actually I have proved that it is at any integer and, maybe, at rational numbers of the form $\dfrac{q}{2^{n}}$, with $q$ odd).
To see this it is enough to see that if $x\in\mathbb{R}$ is such that $|x|<\dfrac{1}{2^{N}}<ε$ then
$$\left|\sum_{k=1}^{\infty}\frac{\{kx\}}{k^{2}}\right|\leq \left|\sum_{k=1}^{S}\frac{\{kx\}}{k^{2}}\right|+\left|\sum_{k=S+1}^{\infty}\frac{\{kx\}}{k^{2}}\right|<\left|\sum_{k=1}^{S}\frac{\{kx\}}{k^{2}}\right|+ε=\left|\sum_{k=1}^{S}\frac{kx}{k^{2}}\right|+ε.$$
Τhese last steps are true because $f(x)$ converges and then there is $J\in \mathbb{N}$ such that $$\left|\sum_{k=n}^{\infty}\frac{\{kx\}}{k^{2}}\right|<ε$$ for all $n\geq J$ and then, if $S=\max\{N,J\}$, $|kx|<\dfrac{k}{2^{S}}<\dfrac{1}{2}$ for all $k\leq S$, and so $|f(x)|<{\mit Γ}ε + ε$ for some constant $\mit Γ$ and therefore $f(x)$ is continuous at $0$.
This same argument can be used to prove that $f(x)$ is continuous at any integer and (maybe) at any rational of the form $\dfrac{q}{2^{n}}$.
Can I generalize for any real number? Or how can I find where $f(x)$ is not continuous?
 A: The function introduced as $\{x\}$ has a simple Fourier series:
$$\{x\}=\sum_{m\geq 1}\frac{(-1)^{m+1}\sin(2\pi m x)}{\pi m} =\frac{1}{\pi}\text{Arg}(1+q),\qquad q=e^{2\pi i x}$$
Here "$=$" holds as an equality in $L^2$ and as a pointwise equality. Convergence is not uniform due to Gibbs' phenomenon, but we have uniform convergence over any compact subset of $\mathbb{R}\setminus\frac{1}{2}\mathbb{Z}$.
Formally
$$\sum_{k\geq 1}\frac{\{kx\}}{k^2}=\sum_{k\geq 1}\sum_{m\geq 1}\frac{(-1)^{m+1}m \sin(2\pi m k x)}{\pi m^2 k^2}=\sum_{n\geq 1}\frac{\sin(2\pi nx)}{\pi n^2}\sum_{d\mid n}(-1)^{d+1} d $$
can be written as 
$$ \text{Im}\sum_{n\geq 1}\frac{q^n}{\pi n^2}\left(3-2^{\nu_2(n)+1}\right)\sigma\left(\frac{n}{2^{\nu_2(n)+1}}\right)=\text{Im}\sum_{m\text{ odd}}\frac{\sigma(m)}{\pi m^2}\sum_{j\geq 0}\frac{q^{2^j m}}{4^j}(3-2^{j+1}) $$
where $\left|\sum_{d\mid n}(-1)^{d+1}d\right|\leq\sigma(n)\ll Cn\log\log n$. On the other hand if $n$ is a product of consecutive, odd prime numbers we have $\sum_{d\mid n}(-1)^{d+1}d=\sigma(n)\gg D n \log\log n$. In particular $f(x)$ is not a function with bounded variation and it has to be discontinuous at some point.
Indeed, it is not difficult to check that the limits at $x\to(1/2)^-$ and $x\to(1/2)^+$ do not match.
This is an approximate graph over $(0,1)$:
$\hspace{1cm}$ 
Addendum: in this context, it might be interesting to stress an interplay between number theory and harmonic analysis. On one hand, informations about the arithmetic function $\sigma(n)$ (like that $\sigma(n)\varphi(n)$ always has order $n^2$) prove that some Fourier series, essentially given by the imaginary part of an Eisenstein series, are not BV. On the other hand, by applying the Laplace transform, the Poisson summation formula and the Hardy-Littlewood tauberian theorem one may recover informations about the average order of some arithmetic function from such Fourier series.
