A function with period 1 and $\alpha$ (irrational) I'm looking for a non-constant function $f(x)$, which there is a irrational number $\alpha$ such that
$$
f(x)=f(x+1)=f(x+\alpha)
$$
for all $x\in\mathbb{R}$.
Note that though the function $f(x)$ do not have a smallest period, but that doesn't mean $f(x)$ must be a constant (the Dirichlet function is a good example, but it failed in this situation).
 A: Fix $\alpha$ irrational. How about :
$$
f(x) = \begin{cases}
0 & \exists r,s \in \mathbb Q , x = r+s\alpha \\
1 & \mathrm{otherwise}
\end{cases}
$$
Then, if $f(x)=0$, $x = r+s\alpha$, so $x+\alpha = r+(s+1)\alpha$ and $x+1 = (r+1) + s\alpha$ ,so $f(x+1) = f(x+\alpha) = 0$.
If $f(x) =1$ then $x$ is not a rational plus a rational multiple of $\alpha$ , then $x+1$ and $x+\alpha$ also cannot be. Thus this function works.
We can see that $f$ doesn't have a smallest period , however. This is because if $f$ is a function such that $f(x) = f(x+1) = f(x+\alpha)$ for some $\alpha$ irrational, then we can easily write $f(x) = f(x +r +s\alpha)$ for any $r,s$ rational, and one can easily show that $\inf\{|r+s \alpha| : r,s  \in \mathbb Q\} = 0$.

From the theory of functional equations, all we need to define such an $f$ is that $f$ be defined on one element of every equivalence class of the relation on $\mathbb R$ given by $x \sim y$ if and only if $x-y = r+s\alpha$ for some $r,s$ rational. Since there are many such equivalence classes, one may easily define $f$ individually on each class and get a multitude of functions which work out.
A: Let $S=\{a+b\alpha\mid a,b\in\mathbb Z\}$, and let $\sim$ be relation on $R$ defined by $$x_1\sim x_1\iff x_1-x_2\in S.$$
Relation $\sim$ is equivalence relation, and it has infinitely many equivalence classes (because $S$ is countable). Let $S_1$ be one equivalence class. Now set $$f\left(x\right)=\begin{cases}1, & x\in S_1 \\ 0, &x\not\in S_1\end{cases}.$$ Function $f$ is periodic with periods $1$ and $\alpha$.
