Prove that $f(x)=\displaystyle{\sum_{n=1}^{\infty}} \dfrac{e^x \sin (n^2x)}{n^2}$ is convergent for every $x \in \mathbb{R}$ and that its sum $f(x)$ is a continuous function on $\mathbb{R}$.
This is my tentative to solve the problem: $f(x)= e^x \sum {\frac{\sin (n^2x)}{n^2}}$. So, to prove that $f(x)$ is convergent, I only need to prove that $\sum {\frac{\sin(n^2x)}{n^2}}$ is convergent. since absolute value of $\frac {\sin (n^2x)}{n^2} \le \frac{1}{n^2}$ because absolute value of $\sin (n^2x)$ is $\le 1$ and the series: $\sum {\frac{1}{n^2}}$ is convergent, then by the $M$-test the series $\sum {\frac{\sin (n^2x)}{n^2}}$ is uniformly convergent and thus $f(x)$ is continuous on $\mathbb{R}$.
Please let me know whether my solution is true? Also, do I have to distinguish the two cases where $x=0$ and $x \ne 0$? Do I have to prove that $f$ is continuous at $x=0$ separately?