Vanessa Johnson Vanessa
Posted on Thursday, 10 April, 2003 - 08:45 pm:

I was hoping someone could give me an example of a function that is discontinuous everywhere but an open set.
Michael Doré
Posted on Thursday, 10 April, 2003 - 09:37 pm:

You mean an open _function_ right, not an open set? (Where an open function is one which sends open sets to open sets.) If this is what you mean then one way is to pick some open interval I in R (say I = (-1,1) or I = R itself) and try and construct a function f such that the image of f on _every_ open interval is I. Such a function would clearly be discontinuous everywhere and would have to send every open set to I. Any ideas on how to construct such a function? (Hint: when trying to construct f(x) from x think about the decimal representation of x.)
David Loeffler
Posted on Thursday, 10 April, 2003 - 11:03 pm:

Or do you mean 'discontinuous everywhere except on an open set'?

David
Michael Doré
Posted on Friday, 11 April, 2003 - 12:57 am:

Oh thanks - silly me, that's a much more plausible way to read the question.

Assuming that David is right, and I'm pretty sure he is, then:

A fairly trivial example is to just let f be a continuous function. Because R itself is an open set, and so f is discontinuous everywhere except on R - because there is nowhere else. Or you could let f be constant on (0,1) and make f do something totally horrible elsewhere e.g. be the indicator function of the rationals. Or you could even let f be discontinuous everywhere.

Or perhaps you meant find a function which is continuous everywhere except on an open set where it is discontinuous (at every point). In this case, again a trivial example is to make f continuous everywhere or discontinuous everywhere. If however you want f to be discontinuous at every point of a non-empty bounded open interval and continuous everywhere else:

Have you come across the function f(x) = x if x is rational and f(x) = 0 otherwise? This is a well known example of a function that is continuous at 0 and nowhere else. This isn't a solution. But can you see how to adapt it to get a function which is continuous everywhere except for (0,1) where it is discontinuous? Hint: make the function zero outside (0,1). It doesn't really matter what happens near the middle of (0,1) as long as the function behaves horribly. However you do need the make the function be continuous at 0 and 1. This is where the function I gave above is helpful.

Michael