Let $X\subset \mathbb R^d$ having non empty interior and let $f:X\to\mathbb{R}$ be lower semicontinuous.
I know that the set of discontinuities of such a function is contained in a meager set, and therefore the set of all points of continuity of $f$ is dense in $X$.
General theory stops here, in the sense that the famous Popcorn function exhibits a map which is continuous precisely on irrational numbers and discontinuous at every rational. But in some sense the definition of the Popcorn function is awkward and seems designed ad hoc to obtain a pathological behaviour.
I was wondering whether or not there exist sufficient conditions on $f$ such that its continuity set has actually non empty interior. A possible answer to such a question would be to require that points of continuity are a closed set and then invoke Baire theorem once again (notice that this fails for the popcorn function), but maybe a less-restricting criterion can be given.
I am looking for references, and I hope that something along these lines exists already in the literature.
Thank you very much!