Continuity question

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?

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.

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.

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.

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

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?

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

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)