The difference between two periodic functions converges to zero, is this two functions identical?

Let $h(x)=f(x)-g(x)$. The assumption $h\to 0$ implies $h(x+T_2)-h(x)\to 0$ as $x\to \infty$. Since $h(x+T_2)-h(x) = f(x+T_2)-f(x)$, it follows that $$f(x+T_2)-f(x)\to 0 \quad x\to\infty \tag{1}$$

As a corollary of (1), for any fixed $x$ we have $$\lim_{n\to\infty} (f(x+nT_1+T_2)-f(x+nT_1)) = 0$$ On the other hand, the expression in parentheses is independent of $n$. Thus, the expression must equal $0$ for all $n$, so $f$ is $T_2$-periodic. It follows that $f-g$ is also $T_2$-periodic. A periodic function with limit $0$ at infinity must be identically $0$.


I wanted to add a little more explanation about how the other answer concludes $f(x)$ is $T_2$-periodic, starting from $$ f(x+T_2)-f(x)\to 0\tag{$*$} $$ Fix $x$, and let $\epsilon>0$. Because of $(*)$, there exists an $M$ so $|x|>M$ implies $|f(x+T_2)-f(x)|<\epsilon$. Therefore, choosing $n$ large enough so $|x+nT_1|>M$, $$ |f(x+T_2)-f(x)|=|f(x+nT_1+T_2)-f(x+nT_1)|<\epsilon $$ Because $|f(x+T_2)-f(x)|<\epsilon$ for all $\epsilon>0$, it follows $f(x+T_2)-f(x)=0$. Therefore, you get $f$ is $T_2$ periodic, and can conclude as in the other proof.