# Proving that a limit of a piecewise constant function does not exist using $\epsilon$-$\delta$

How would one go about proving that the limit of $$f:[0,1)\cup(1,2]\to\{1,2\}\\ x\mapsto \begin{cases} 1&\text{if }x\in[0,1)\\ 2&\text{if }x\in(1,2] \end{cases}$$ as $x\to 1$ does not exist? I attempted to proceed by contradiction.

Suppose $\displaystyle\lim_{x\to 1} f(x)=L$ exists. Then $\forall\,\epsilon>0$, $\exists\,\delta>0$ such that $$0 < |x-1|<\delta\Longrightarrow |f(x)-L|<\epsilon$$

Now I know that it is impossible to find an appropriate $\delta$ if we take $\epsilon=\frac{1}{3}$ for example, since the leap $f$ at $x=1$ is of length $1$. So so far I wish to show that

$$0 < |x-1|<\delta\Longrightarrow |f(x)-L|<\frac{1}{3}$$ is impossible. But how can I proceed from here? I have to substitute $f(x)$ somehow, but I'm not sure how to go about it.

Also, note that I do not wish to involve Left-hand/Right-hand limits at this point (we haven't covered those yet).

You have the right idea in mind. Here is how to formalize. Suppose $\lim_{x\to 1}f(x)=L$ for some $L$. Take $\epsilon=1/3$. Then, there is a $\delta > 0$ such that $0<|x-1|<\delta\implies |f(x)-L|<1/3$. Let $x_{1}=1+\delta/2$ and $x_{2}=1-\delta/2$. It is easy to see that $0<|x_{i}-1|<\delta$ for $i=1,2$. Hence, $$|f(x_{1})-L|<\frac{1}{3}\qquad\text{and}\qquad|f(x_{2})-L|<\frac{1}{3}$$
But, the triangle inequality implies $$1=|2-1|=|f(x_{1})-f(x_{2})|\leq |f(x_{1})-L|+ |f(x_{2})-L|<2/3,$$ a contradiction.
• Well, I think it's just practice. But, you had virtually all of the right ideas. You recognized what a correct $\epsilon$ might be. The rest is just formalizing the geometric image in your head. Good luck!