Proving a piece-wise function does not converge

Question: Does the function $$f(x)=\{1$$ if $$x\in \Bbb Z$$, $$0$$ if $$x \notin \Bbb Z$$, tend to zero as $$x$$ tends to infinity?

Not sure how to do the piece-wise function, feel free to edit or tell me how to. I've used the comma instead to illustrate a new line.

Defintion for a function $$f(x)$$ which tends to $$0$$ as $$x$$ tends to infinity:

$$\forall \varepsilon > 0 \exists K \in \Bbb R \forall x>K :|f(x)|<\varepsilon$$

My claim: Does not tend to zero as $$x$$ tends to infinity. The logic behind my claim is that if I were to imagine a graph of this, there would be two dotted lines, one at $$y=0$$ and another at $$y=1$$.

I find proving questions like these quiet difficult. I usually start off by writing what I need to prove, in this case I need to prove the negation. Then I would proceed with finding my choices for $$\varepsilon$$ and $$x$$, this is where I am struggling at the moment.

• Calculate $\varliminf$ and $\varlimsup$ of $f$ at infinity. These are different so $f$ does not converge. – zwim May 12 at 12:56
• Take $\epsilon=1/2$ and for each $K$ take $x=\lceil K\rceil+1$. That proves that $\exists \epsilon >0$, the $1/2$ value, such that $\forall K$ there exists $x>K$, the value $x=\lceil K\rceil + 1$, such that $|f(x)|=1>1/2=\epsilon$. This is $|f(x)|<\epsilon$ is false. – logarithm May 12 at 12:57
• @zwim Do you mean take the limit of the top, and the bottom and then conclude since they are not the same then $f$ does not converge? I get the concept behind this but what theorem are you using to get to this conclusion? – ViB May 12 at 13:00
• The value $1$ is taken for arbitrarily large values of $x$. This value is at distance $|1-0|=1$ from the supposed limit $0$. The idea is to take $\epsilon$ to be any number smaller than that distance. All we needed was the inequality $1>1/2$. You could have taken $e/\pi$, or $\pi/4$, or $0.yourbirthday$, anything less than $1$ and larger than $0$. The choice of $x$ is more relaxed, all you need is that when you are given a $K$ you take some integer $x>K$ at which $f(x)=1$. – logarithm May 12 at 13:02
• $\varliminf$ and $\varlimsup$ are alternate notations for $\liminf$ and $\limsup$ – saulspatz May 12 at 13:09