$x_n$ is equal to $x_{n-1}-\frac 1n$ if $x_{n-1}+\frac 1n \ge a$ and is else equal to $x_{n-1}+\frac 1n$ where $a$ is any real number and $x_0$ is a rational number (its usually defined by $\lfloor a \rfloor$). Does that mean that $$\lim_{n\to \infty} x_n = a?$$ And how fast does it converge to $a$? You could actually write $x_n$ as $\displaystyle\sum_{k=1}^n \dfrac {c_k}k$ where $c_k$ is either $-1$ or $1$.
I was also wondering if its possible to replace $\dfrac 1n$ with any other function that converges to zero. If so, does that mean that the summation of this function (like the harmonic series $\frac 1n$) needs to diverge?
Some broad hints, to let you keep exploring on your own: