Let $f(x)$ and $g(x)$ be strictly increasing linear functions from $\mathbb{R}$ to $\mathbb{R}$ such that $f(x)$ is an integer if and only if $g(x)$ is an integer. Prove that for any real number $x$, $f(x) − g(x)$ is an integer.
I let $f(x)=ax+b$, $g(x)=px+q$, $t=\frac{k-q}{p}$, where $k$ is some integer. So $g(t)=k$, and $f(\frac{k-q+1}{p})-f(\frac{k-q}{p})=\frac{a}{p}=m$ is an integer where $a,p>0$. So $f(x)-g(x)=p(m-1)x+b-q=(m-1)g(x)+b-mq$. I'm not sure how to prove it's an integer for all real $x$ though. Please give some hints, thanks!