Can we make $\tan(x)$ arbitrarily close to an integer when $x\in \mathbb{Z}$?

Yes, you can. In fact, you can make $\tan(N)$ arbitrarily close to your favorite integer.

Pick your favorite integer, which is probably 17. Consider $x=\arctan 17$. Then $\tan(x)=17$ and also $\tan(x+n\pi)=17$ for all integers $n$. If you could make $x+n\pi$ very close to an integer (say $K$), then since the tangent function is continuous, $\tan(K)$ will be very close to 17.

So the problem is now to make $x+n\pi$ very close to an integer. This can be done because the multiples of $\pi$ (or any irrational number) are dense mod 1, so you can make $n\pi$ arbitrarily close to $-x$ mod 1. This takes proof but it is elementary: think about a circle of circumference 1, and start walking around the circle, around and around, marking a point each time your total distance travelled is a multiple of $\pi$. You'll see the marks start to fill in the circle, and as you go on and on, the largest interval without a mark in it keeps getting smaller. Eventually you will mark a point that's within $\epsilon$ of $-x$.


Fairly random (and definitely unrelated) web surfing turned up this nice short paper of Cheng and Zheng which proves in a very constructive way that if $f: \mathbb{R} \rightarrow \mathbb{R}$ is any continuous function which is periodic with irrational period, then $f(\mathbb{N})$ is dense in $f(\mathbb{R})$.

The ideas are first exhibited with respect to the function $f(x) = \sin x$.

Your question is not literally a special case of this, since $\tan x$ is not continuous on all of $\mathbb{R}$. Nevertheless I think it is close enough for the same methods to be carried over. (For instance, $\tan x$ can be viewed as a continuous function with values in $\mathbb{R} \mathbb{P}^1 \cong S^1$.) In any case the relation here is close enough so that I thought the paper would be of interest to readers of this question.