There is a hint in my book to solve the problem. It goes as follows-
Suppose, $f:\Bbb{R}\to\Bbb{R}$ is continuous and has the period $p\in\Bbb{R}$. Hence, $f(x+np)=f(x)\forall x\in\Bbb{R}, \: \forall n\in\Bbb{Z} $
Thus, $f$ is continuous on $[0,p]\implies f$ is uniformly continuous on $[0,p]$.
Choose $\varepsilon>0$, then $\exists \delta>0$ such that if $|x-y|<\delta,\:x,y\in[0,p]$ we have $|f(x)-f(y)|<\varepsilon$
Now, take any two $x,y\in\Bbb{R}$ with $|x-y|<\delta$. Now, we can find an integer $j$ such that $x+jp,\: > y+jp \in[0,p]$. Then $|x-y|<\delta\implies|(x+jp)-(y+jp)|<\delta$, hence from the uniform continuity of $f$ on $[0,p]$ we have $|f(x+jp)-f(y+jp)|<\varepsilon\implies|f(x)-f(y)|<\varepsilon$
Therefore, $\forall x,y\in\Bbb{R}$ with $|x-y|<\delta\implies|f(x)-f(y)|<\varepsilon$ and this is true for any arbitrarily chosen $\varepsilon>0$.
Now, my question is:: How for $x,y\in\Bbb{R}$ we can have SAME $j\in\Bbb{Z}$ for which both of $(x+jp),\:(y+jp)\in [0,p]$. Although I can establish that we can find $n, m\in\Bbb{Z}$ such that $(x+np),\:(y+mp)\in [0,p]$(beacuse $x,y\in\Bbb{R}\implies\exists n_1,m_1\in\Bbb{Z}$ such that $(n_1-1)p\le x\le {n_1}p,\:(m_1-1)p\le y\le {m_1}p\implies 0\le x-(n_1 -1)p\le p, \: 0\le y-(m_1 -1)p\le p$, now just fix $(n_1 -1)=n,\: (m_1 -1)=m$). BUT HOW THESE $n,m\in\Bbb{Z}$ CAN BE SAME?
Can anybody clear up my confusion?
Thank for your help in advance!