# Continuity question

**URL:** <https://boards.straightdope.com/t/continuity-question/129575>\
**Category:** Factual Questions\
**Created:** [September 25, 2002, 4:50am UTC](https://boards.straightdope.com/t/continuity-question/129575 "2002-09-25T04:50:27Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)\
**Post date:** [September 25, 2002, 4:50am UTC](https://boards.straightdope.com/t/continuity-question/129575/1 "2002-09-25T04:50:27Z")

</div>

I’ll be darned if I can figure this one out.

Let f(x) = x - a if x is irrational, and a - x if x is rational. The claim was made that f is continuous only at a. I’m pretty sure it isn’t, but I haven’t got a proof. I know that it’s not everywhere continuous–otherwise, it would have to coincide with x - a or a - x. So what’s the deal? Where is this function continuous?

---

<div class="post-metadata">

**Author:** ![andy\_fl](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@andy\_fl](https://boards.straightdope.com/u/andy_fl)\
**Post date:** [September 25, 2002, 4:59am UTC](https://boards.straightdope.com/t/continuity-question/129575/2 "2002-09-25T04:59:00Z")

</div>

Continuous only at x=a

Left hand Limit(x–\>a) = x-a or a-x = 0 (-0 or 0 is the same)  
Right hand Limit(x–\>a)=x-a or a-x = 0 (" ")  
x=a, f(x) = a

Hence Limit exists only at a and is 0.

---

<div class="post-metadata">

**Author:** ![Achernar](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@Achernar](https://boards.straightdope.com/u/Achernar)\
**Post date:** [September 25, 2002, 5:02am UTC](https://boards.straightdope.com/t/continuity-question/129575/3 "2002-09-25T05:02:31Z")

</div>

I have to agree with the claim as well. This makes me think of another function that I like.

g(0) = 1  
g(p/q) = 1/q, where p/q is a rational number in simplest form.  
g(x) = 0 for all irrational x.

For any a, the limit of g(x) as x approaches a is 0. So g(x) is continuous at all irrationals, and discontinuous at all rationals.

---

<div class="post-metadata">

**Author:** ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)\
**Post date:** [September 25, 2002, 5:02am UTC](https://boards.straightdope.com/t/continuity-question/129575/4 "2002-09-25T05:02:37Z")

</div>

It definitely is continuous at a.

But for any rational number q, you can construct a sequence of rational numbers converging to q. For any x[sub]n[/sub] in the sequence, f(x[sub]n[/sub]) = a - x[sub]n[/sub]. The limit as n goes to infinity of a - x[sub]n[/sub] is a - q. So it would seem that f is continuous on the rationals, unless I’ve made a mistake.

---

<div class="post-metadata">

**Author:** ![Achernar](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@Achernar](https://boards.straightdope.com/u/Achernar)\
**Post date:** [September 25, 2002, 5:08am UTC](https://boards.straightdope.com/t/continuity-question/129575/5 "2002-09-25T05:08:02Z")

</div>

Oh, continuous on the rationals. I assumed you meant continuous on the reals. Sorry.

---

<div class="post-metadata">

**Author:** ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)\
**Post date:** [September 25, 2002, 5:22am UTC](https://boards.straightdope.com/t/continuity-question/129575/6 "2002-09-25T05:22:55Z")

</div>

Well, I did mean continuous on the reals. But I found my error, shortly after I turned the computer off for the night. Ain’t it always the way?

---

<div class="post-metadata">

**Author:** ![Achernar](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@Achernar](https://boards.straightdope.com/u/Achernar)\
**Post date:** [September 25, 2002, 5:25am UTC](https://boards.straightdope.com/t/continuity-question/129575/7 "2002-09-25T05:25:21Z")

</div>

Yeah, I find that it usually happens to me about five seconds before someone posts telling me what I did wrong.

---

<div class="post-metadata">

**Author:** ![The\_Great\_Unwashed](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/the_great_unwashed/32/4791_2.png) [@The\_Great\_Unwashed](https://boards.straightdope.com/u/The_Great_Unwashed)\
**Post date:** [September 25, 2002, 3:01pm UTC](https://boards.straightdope.com/t/continuity-question/129575/8 "2002-09-25T15:01:38Z")

</div>

On last night’s Open University slot on Algebra, the presenter had a tie on in one shot, and then was open-necked in the next.

There’s a discontinuity I thought.

(humblest apologies)
