# Countable and uncountable number [closed]

Is there a function that has an uncountable number of continuity points and an uncountable number of discontinuity points in any neighborhood contained in the interval $$(0,1)$$?

• This answer shows that many functions that are also derivatives have this property. In fact, the Baire category part immediately implies (along with the fact that every continuous function is a derivative) that given any continuous function $f$ defined on $(0,1)$ and given any $\epsilon > 0,$ there exists uncountably many such functions (i.e. functions that are derivatives and have the property you want) whose graphs lie within an "$\epsilon$-tube" with the graph of $f$ as its "axis". – Dave L. Renfro Dec 12 '19 at 17:41
• This answer indicates that there are functions with the property you want that additionally satisfy the property $\lim\limits_{h\rightarrow 0}\ [f(x+h)-f(x-h)]=0$ at each $x \in (0,1).$ – Dave L. Renfro Dec 12 '19 at 17:48
• You're trying to force your answer on me. --- Being curious, I looked at the revisions. The original version of the question asked for uncountably many discontinuity points and uncountably many continuity points, which the accepted answer does not give. (It gives an answer to the much simpler question in which "uncountably many continuity points" is not required.) The first time each of these conditions is required in every neighborhood is the 3rd revision, which was made by you. So I don't see any support for your claim, at least based on what the editing archive record shows. – Dave L. Renfro Dec 24 '19 at 16:41
• It gives an answer to the much simpler question ... FYI, I realize that the answer @Adam Martens gave is correct for the version of the question that was showing at the time his/her answer was given. – Dave L. Renfro Dec 24 '19 at 16:44

Sure. If $$x\in (0,1/2)$$, let $$f(x)=0$$. So $$f$$ is continuous on this interval. On $$[1/2,1)$$, we can define $$f$$ to be discontinuous everywhere. For instance, $$f=1_{\mathbb{Q}}$$ would do.

• $1_{\mathbb Q}$ is discontinuous at every rational. But the rationals are countable, aren't they ? – Yves Daoust Dec 12 '19 at 17:09
• @YvesDaoust It's discontinuous everywhere, including on the irrationals. – kccu Dec 12 '19 at 17:10
• @Yves Daust are you claiming Dirichlet function has countable number discontinuity points? – TheHolyJoker Dec 12 '19 at 17:11
• It is discontinuous at the rationals because it is infinitely close to irrationals on either side, but it is also discontinuous at the irrationals because there are rationals infinitely close on both sides. – Zhuli Dec 12 '19 at 17:11
• Then post a new question – Adam Martens Dec 12 '19 at 17:23

A set $$G\subseteq \mathbb R$$ is $$G_\delta$$ (that is, a countable intersection of open sets) if and only if there exists a function $$f\!:\mathbb R\to\mathbb R$$ that is continuous at each point of $$G$$ and discontinuous at each point of its complement.

The result you are requesting follows from noticing that there are $$G_\delta$$ sets $$G$$ such that both $$G$$ and its complement have uncountable intersection with any open interval.

First, the set of points of continuity of a function is $$G_\delta$$: $$f$$ is continuous at $$x$$ if and only if $$x$$ is in the intersection of the open sets $$U_n$$, where $$U_n=\{y\in\mathbb R:\exists\delta>0\,\forall x,z\in(y-\delta,y+\delta)\,(|f(x)-f(z)|<1/n)\}.$$

Second, any $$G_\delta$$ set $$G$$ is the set of continuity points of a function. To see this,

(a) note first that if $$U$$ is an open interval one can easily build $$f$$ that is continuous (even 0) outside of $$U$$ and discontinuous everywhere in $$U$$. From this, one easily gets the same for any open set $$U$$.

(b) Now, given a $$G_\delta$$ set $$G$$ whose complement does not contain any interval, write $$G$$ as $$\bigcap_n U_n$$ where the complement $$C_n$$ of $$U_n$$ is closed nowhere dense, consider $$f(x)=\sum_n2^{-n}\chi_{C_n}(x)$$ and note that $$f$$ is continuous at each point of $$G$$ and discontinuous at any point in its complement.

(c) The result easily follows for arbitrary $$G_\delta$$ sets $$G$$ by combining (a) and (b).

Third, there are $$G_\delta$$ sets $$G$$ such that $$G$$ and its complement have uncountable intersection with any open set. For instance, let $$(q_n:n\ge0)$$ enumerate the rationals. For $$i,j\in\mathbb N$$ let $$I_{i,j}=\left(q_i-\frac1{2^{i+j}},q_i+\frac1{2^{i+j}}\right),$$ $$G_j=\bigcup_i I_{i,j}$$ and $$G=\bigcap_j G_j$$. The set $$G$$ is $$G_\delta$$, by construction.

Note that the measure of $$G_j$$ is at most $$\frac1{2^j}\sum_i\frac2{2^i}=\frac4{2^j}$$, so $$G$$ has measure 0. It follows that the complement of $$G$$ has full measure and therefore meets every interval in an uncountable set.

At the same time, the complement of $$G$$ is the countable union of the sets $$G_j^c$$, each of which is nowhere dense, so $$G$$ is comeager and also hits every interval in an uncountable set.

The construction above is quite flexible and additional properties can be required of $$f$$, as pointed out in the comments.

Yes, there are many such functions.

For example let $$f(x)=0, \text{ if } x\ge 1/2$$

$$f(x)=1, \text{ if } x\notin Q, x<1/2$$ $$f(x)=-1, \text{ if } x\in Q, x<1/2$$