Suppose $f\in C(\mathbb R )$, and we take supremum from all $x\in\mathbb R,k_1,k_2\in\mathbb Z$.
I doubt that there won't exist such a function, for $k_1,k_2$ are integers but the function's period is irrational. But I can't clearly turn this thought into formal proof. Any help would be appreciated!