Does a function that is everywhere upper semicontinuous and nowhere continuous exist?

265 Views Asked by At

Definition. A function $f:\mathbb R\to\mathbb R$ is called upper semicontinuous at $x^\ast$ if for every $\varepsilon>0$ there exists a $\delta>0$ such that for $x\in B(x^\ast,\delta)$ we have $f(x)<f(x^\ast)+\varepsilon$.

I've been thinking about examples-counterexamples in some definitions I've run into recently, and right now I'm looking for a function that is everywhere upper semicontinuous and nowhere continuous, or if no such function exists, a proof of it.

I'll say that this is pretty nonobvious to construct but my intuition suggests such a function exists. If the function vanishes on the irrationals but somehow approaches every irrational from above on the rationals in every neighborhood it should be everywhere upper semicontinuous and nowhere continuous.