Considering a function $f$ exponentially decreasing at infinity, is the following function $\mathbb{Q}$ periodic ?


$$F(x)= \sum\limits\_{q =1}^{\infty} \; \sum\limits\_{n =1}^{\infty} \; \sum\limits\_{\underset{(p,q)=1} {p=1}}^{q-1} f(n) \; e^{2 i \pi n (x+ \frac{p}{q}) }$$


First of all, the existence of the sum does not seem obvious. Then the fact that adding a rational to $x$ (it will change the order of summation) does not change the sum is absolutely not obvious (See example in my previous post: [On construction of a $\mathbb{Q}$ periodic function with Fourier series](https://mathoverflow.net/questions/238320/on-construction-of-a-mathbbq-periodic-function-with-fourier-series/238781#238781), as above, a potential $\mathbb{Q}$ periodic function was proposed, unfortunately it did not work)



Is this function $\mathbb{Q}$ periodic?
Your sum diverges for most $x\in\mathbb{R}$. The innermost sum is
$$\sum\limits\_{\underset{(p,q)=1} {p=1}}^{q-1} f(n) \; e^{2 i \pi n (x+ \frac{p}{q}) } = f(n)e^{2 i \pi nx}\sum\limits\_{\underset{(p,q)=1} {p=1}}^{q-1}e^{2 i \pi n\frac{p}{q} } = f(n)e^{2 i \pi nx}\sum\_{d\mid (n,q)}d\mu\left(\frac{q}{d}\right),$$
by the well-known formula for [Ramanujan's sum](https://en.wikipedia.org/wiki/Ramanujan's_sum). If $q$ is prime, then this simplifies to
$$ f(n)e^{2 i \pi nx} \left(-1+q\cdot 1\_{q\mid n}\right),$$
where $1\_{q\mid n}$ is $1$ or $0$ depending on $q\mid n$ or $q\nmid n$. At any rate, for $q$ prime, the $n$-sum equals (upon writing $n=qm$ when $q\mid n$)
$$ -\sum\_{n=1}^\infty f(n)e^{2 i \pi nx} + q\sum\_{m=1}^\infty f(qm)e^{2 i \pi qmx}.$$
If your original sum converges, then this expression tends to zero as $q\to\infty$. However, the second sum itself tends to zero as $q\to\infty$ by the exponential decay of $f$, so the first sum (which is independent of $q$) is zero:
$$ \sum\_{n=1}^\infty f(n)e^{2 i \pi nx} = 0. $$
So this is a necessary condition for the convergence of your sum. Unless $f$ is identically zero, this condition fails for a typical $x\in\mathbb{R}$.


BTW if an infinite sum of continuous functions converges uniformly, then the sum is also continuous. In addition, any continuous $\mathbb{Q}$-periodic function is constant.


**Added.** Two comments. First, Ramanujan's formula for the quoted special case is very simple, it simply says that the sum of $q$-th roots of unity equals zero. Second, as Robert Israel remarked, the necessary condition on $x$ only holds for finitely many values modulo $1$.


