# Riemann integrable function which is discontinuous at an uncountable number of points on every open set?

Let $$n$$ be some positive integer. Does there exist a Riemann integrable function $$f: [0,1]^n \to \mathbb{R}$$ with the following property: for every non-empty open subset of $$U \subset (0,1)^n$$, the set $$\{x \in U \ \mid \ f \text{ is discontinuous at } x \}$$ is uncountable?

I don't really know how to approach this. I know that a function is Riemann integrable if and only if it is bounded and continuous almost everywhere.

I tried to see if, for instance, I can somehow construct a function like this, such as the characteristic function on the Cantor set in $$[0,1]$$ (which does not satisfy the above property) and extend it to $$[0,1]^n$$, but I did not succeed.

• The set of jump discontinuous can be countable, not just finite, right?
– S.T.
Feb 27, 2021 at 14:10
• Also, the Dirichlet function is discontinuous in every point. For if you fix $x \in [0,1]$, then if you approach $x$ via the rationals, then the limit of the Dirichlet function is $1$, but if you approach $x$ via the irrationals, the limit is $0$.
– S.T.
Feb 27, 2021 at 14:17
• Dirichlet function is everywhere discontinuous by just choosing any $\epsilon<1$ on the definition. @S.T. Do you know if the result you posted holds if we just ask $\{x\in[0,1] : f \text{ is discontinuous at } x\}$ to be uncountable? Feb 27, 2021 at 14:24
• It should be well known that monotone functions have jump discontinuities only, there are at most a countable number of them and it is Riemann integrable. This is for single variable calculus. Also as noted Dirichlet function is discontinuous everywhere. Feb 27, 2021 at 14:26
• @R.V.N. The characteristic function on the Cantor set is discontinuous on the Cantor set, which is uncountable, but it is still Riemann integrable, as the Cantor set has measure zero.
– S.T.
Feb 27, 2021 at 14:31

Here is an example for $$n=1$$:
It is known that if $$S$$ is a $$F_\sigma$$ set (a countable union of closed sets) in $$\Bbb R$$, then there is a function $$f:\Bbb R \rightarrow\Bbb R$$ whose set of discontinuities is $$S$$. See this post for a reference to a proof.
So, it suffices to find an $$F_\sigma$$ in $$\Bbb R$$ of measure zero with the property that its intersection with any non-degenerate open interval is uncountable. Towards this end, for each pair of distinct rationals, construct a Cantor set between them; then take the (countable) union over all such sets. It is easily verified that this gives what's required.
• To follow-up on my yesterday's comment (I was out of characters, the comment having 2 or 3 characters left, and didn't feel like continuing with another comment), the reason we get "everywhere of Hausdorff dimension $1$" is that given any nonempty open interval $I,$ there exist infinitely many $n$ such that $I_n\subseteq I,$ and so for every $\epsilon > 0$ and for every nonempty open interval, the intersection of the set with that open interval has Hausdorff dimension greater than $1-\epsilon,$ which implies the intersection of the set with that open interval has Hausdorff dimension $1.$ Feb 28, 2021 at 17:15