Define equivalence relation on set of real numbers so distinct equivalence classes are $[2k,2k+2)$ Define an equivalence relation $\sim$ on $\mathbb{R}$ such that the distinct equivalence classes of $\sim$ are $[2k,2k+2)$, where $k$ is an integer (Hint: find an appropriate function $f$ with all real numbers as its domain and let $R = \{(x,y)|f(x)=f(y)\}$.)
I feel like I can do these problems, but starting out I almost never know what is being asked. I am so utterly confused. I know what an equivalence relation is, and I know what equivalence classes are, but how can equivalence classes be $[2k,2k+2)$ with $k $ integer? I think I'm confusing myself further.

So we will follow the hint. We want a function that has the same value on two reals $x$ and $y$, if they only if they belong to the same interval $[2k, 2k+2)$. So for instance let us put $f(x) = k$ whenever $x \in [2k, 2k+2)$. You need to prove that this is a well-defined function, and that it answers your question.
