I'm going to give a less technical answer than what others have written here, because I think you must have missed something other than that part if you didn't think of $x\mapsto e^{2\pi ix}$.
You have $x\sim y\Leftrightarrow x-y\in\mathbb{Z}$. That means $0$ becomes the same point as $1$, while everything between $0$ and $1$ is a different point from the one point that is $0\sim1$. And $0.1$ becomes the same point as $1.1$, and $0.2$ becomes the same as $1.2$, and so on. In other words, moving along the interval from $0$ to $1$, you return to your starting point and start over, just as with the circle. Therefore, the interval $[0,1]$ should get wrapped around the circle, with $0$ and $1$ getting mapped to the same point. In then the interval $[1,2]$, being the same as $[0,1]$ in the quotient space, gets wrapped around the circle in the same way, with $2$ being mapped to the same point on the circle to which $0$ and $1$ were mapped, and so on.
When you learned trigonometry, you saw $(\cos(2\pi x),\sin(2\pi x))$ wrapping around the circle in that same way. Since those are periodic functions with period $1$, it follows that if $x\sim y$ then $(\cos(2\pi x),\sin(2\pi x))=(\cos(2\pi y),\sin(2\pi y))$, so that is the mapping you need.