$a_n(x):=nx-\lfloor nx \rfloor$

i have $a_n(x):=nx-\lfloor nx \rfloor$ where $x$ is real. i want to show that if $x$ is rational, then $a_n(x)$ has finitely many cluster points, if $x$ is irrational, then every real $a$ with $0\leq a \leq 1$ is cluster point of $a_n(x)$. i dont know where to start, through your help, i will understand cluster point, sequences more deeply. i am stuck how to show those 2 cases, i am still bad at proof-thinking.

-
You will find some useful information in this related question. – Old John Dec 29 '12 at 12:05
Don't know where to start? Start by retrieving the relevant definitions ("cluster point", "rational" etc) and write down what they mean in the particular case of your $a_n(x)$. – Henning Makholm Dec 29 '12 at 12:19
okay thanks, Henning – doniyor Dec 29 '12 at 13:17

HINT: If $x$ is rational, we can write $x=m+\frac{a}n$ for some integers $m,a$, and $n$ such that $n>0$ and $0\le a<n$. (Why?) Clearly $m=\lfloor x\rfloor$ and $a_1(x)=\frac{a}n$. Then
\begin{align*} a_k(x)&=kx-\lfloor kx\rfloor\\ &=km+\frac{ka}n-\left\lfloor km+\frac{ka}n\right\rfloor\\ &=km+\frac{ka}n-\left(km+\left\lfloor\frac{ka}n\right\rfloor\right)\\ &=\frac{ka}n-\left\lfloor\frac{ka}n\right\rfloor\;. \end{align*}
Use this to find a very simple relationship between $a_k(x)$ and $a_{k+n}(x)$.
This answer to an earlier question covers the case of irrational $x$; it’s complete, but it’s pretty concise, so you may have to stare at it a bit to see just how it works.