# How to tackle limit question using epsilon-delta?

Consider the function, with domain $\mathbb{R}$, defined by

$$f(x) = \begin{cases} x & \text{if x is rational,} \\ -x & \text{if x is irrational.} \end{cases}$$

Prove that $\lim_{x\rightarrow 0}f(x)=0.$

Obviously, intuitively, the limit is $0$. But how do I prove this by definition?

My attempt:

Let $\epsilon>0$. Then $\exists\delta > 0$, such that, if $0<|x-0|<\delta$, then $|f(x)-0|<\epsilon$, i.e.,$|x-0|<\epsilon \Rightarrow |x|<\epsilon$.

Then, $$|f(x)-0|<\epsilon \text{ iff } |(x)-0|<\epsilon$$ $$|x|<\epsilon$$ Choose $\delta = \epsilon$ it follows that $|f(x)-0|<\epsilon$.

Just want to see if this fulfills the proof. All critiques welcome.

• You have already spotted the proof. Just remember to take an arbitrary epsilon, and show that your proposed delta indeed works. In this case take $\delta = \epsilon$ Oct 25, 2017 at 23:46
• Hint: $|f(x)-0|=|\pm x|=|x|$. Oct 25, 2017 at 23:46
• Can you elaborate @SimplyBeautifulArt Oct 25, 2017 at 23:46
• Can you prove that $g(x)\to0$ as $x\to0$, where $g(x)=x$? From my previous comment, your problem is rather similar in nature. Oct 25, 2017 at 23:48
• Well haven't I technically proven that in my attempt? Oct 25, 2017 at 23:49

To show the existence of a limit in our case:

We are given $\epsilon > 0$, and we have to find a $\delta > 0$ such that whenever $|x -0| < \delta$ is true, it must also be true that $|f(x) - 0| < \epsilon$.

I see some problems. For one, how do you go from $|f(x) - 0| < \epsilon$ to $|0-0| < \epsilon$? Note that this is true only if $x = 0$, whereas you need to show that it is true for $|x -0| < \delta$ for some $\delta$.

Note that if for any $\epsilon > 0$ we pick $\delta = 0.5$, then this won't work out. An example is when $\epsilon = 0.1$ and $x = 0.2$, then while it is true that $|x - 0| < 0.5$, it is not true that $|f(x) - 0| < 0.1$. Therefore, $\delta = 0.5$ does not work for $\epsilon = 0.1$.

In our case, you believe that you intuitively have got the idea of why the limit is zero. The correct proof is as follows:

Note that $f(x) = x$ or $-x$ depending on some circumstances. Either way, $|f(x)| = |x|$. Therefore, for any $x$ and $\epsilon$, $|f(x)| < \epsilon$ if and only if $|x| < \epsilon$. Now, if we choose $\delta = \epsilon$, we see that whenever $|x| < \delta = \epsilon$, by the above statement we have $|f(x)| < \epsilon$. Therefore, the limit is established to be zero.

Please read this proof carefully before attempting comments. I would prefer it if you tell me exactly what the problem is.

EDIT : Okay, thank you for the response, now I will show you what exactly the squeeze theorem means.

So let's say we have three functions, $f(x),g(x),h(x)$. Now, suppose there is some point $a$, such that for $x$ "near" $a$ (that is, for $|x - a| < \delta$ for some appropriately chosen $\delta$), $f(x) \leq g(x) \leq h(x)$ is true. This is like putting the graph of $g$, in between both $f$ and $h$.

Now, suppose that $\lim_{x \to a} f(x)$ and $\lim_{x \to a} h(x)$ both exist and are equal. What does this mean? This means that as $x$ gets closer to $a$, both $f$ and $h$ get closer to the same point. But what does this imply about $g$? $g$, suffocated between $f$ and $h$, must go to the same point, right?

That is, a function squeezed between two other functions going to the same point, also must go to that point. This is the essence of the squeeze theorem, whose result would be that $\lim_{x \to a} g(x)$ exists, and equals the limit for $f$ or $h$.

Here, if we take $g(x) = x$ if $x$ is irrational and $-x$ otherwise, then take $f(x) = -x$ and $h(x) = x$, we see that $g$ squeeze between $f$ and $h$, but both $f$ and $h$ have the limit $0$ at $x = 0$, so $g$ must also have the same limit (no $\epsilon-\delta$ business involved here).

The idea with these tricks, is to eliminate your use of $\epsilon-\delta$ arguments for these situations, and come up with more slick proofs. I hope this will motivate you to read further.

• Have seen the edited proof. It is correct. I will edit this post, if you like, to explain how the squeeze logic works. Oct 26, 2017 at 0:01
• If you can include the squeeze theorem, that would be great. But my edit seems correct, right? I like the way you include the $|x|$. Oct 26, 2017 at 0:02
• Yes, your edit is correct. I will edit my answer then. Oct 26, 2017 at 0:05
• Edited. Please have a look. Oct 26, 2017 at 0:14
• This is incredible. Thank you so much. I have an additional question that I will include in the next edit Oct 26, 2017 at 0:20

Does it have to be an $\varepsilon$-$\delta$ proof? This can be done via the squeeze theorem. In particular, try squeezing your function betweeen $-|x|$ and $|x|$.

By the way, your attempted proof is incorrect, insofar as you're assuming something "then $\exists \delta > 0$ such that..." which really, you're meant to be trying to prove. You can use my answer here to guide you in the writing of these proofs. Though ignored, it's quality is very high.

• Can you help me work through this? Oct 25, 2017 at 23:47
• Having a hard time relating the suggested guide to this proof. Oct 25, 2017 at 23:53
• @sgerbhctim Could you be more specific as to what's giving you a hard time? Oct 25, 2017 at 23:56
• @sgerbhctim, did you Google "squeeze theorem?" If you don't search for unfamiliar terms in people's answer before asking them for further help, you're going to end up annoying people... Oct 26, 2017 at 0:01

Hint: the absolute value of your function is just the function $g(x)=|x|$.

The purpose of this hint is that in taking the absolute value of your function (as you do in a delta epsilon proof) and seeking to bound it by a given epsilon, the difference in the functions definition on the rationals and irrationals is lost.

i.e. take $\epsilon>0$ fixed. Then $$|x|<\delta\implies |f(x)|=|x|<\delta$$ so it will suffice to take $\delta=\epsilon$.

• Not true, probably not useful to the OP..
– Did
Oct 26, 2017 at 1:27
• OK, what's $f(\sqrt2)$? - From Review Oct 26, 2017 at 1:37
• @ParclyTaxel $f(\sqrt{2})=-\sqrt{2}$, $|f(x)|=\sqrt{2}$, which is my point Oct 26, 2017 at 1:42
• @ParclyTaxel please let me know if this addressed your concerns, if not I will go ahead and delete it myself. Oct 26, 2017 at 1:44
• Yes${}{}{}{}{}$ Oct 26, 2017 at 1:45