If the two functions are continuous this can't happen but what if one of them (or both) is discontinuous. I found an article but it's behind paywalls. I just need an example.
Let $A=\{p+q\sqrt{2}: p,q\in\mathbb{Q}\}$ and $B=\{p+q\sqrt{3}: p,q\in\mathbb{Q}\}$. The indicator of $A$, $\textbf{1}_A$, is periodic. Its periods are the elements of $A$. The same for $\textbf{1}_B$. These two functions have incommensurable periods, namely $\sqrt{2}$ and $\sqrt{3}$, but their sum $\textbf{1}_A+\textbf{1}_B$ is also periodic. So the sum of two periodic functions with non-commensurate periods can be a periodic function.
Can the sum of two periodic functions with non-commensurate fundamental periods be a periodic function?