TITLE: Can the supremum of continuous functions be discontinuous on a set of positive measure?
QUESTION [7 upvotes]: Given a sequence of continuous functions $f_n(x)$, all defined on a compact set $D$ and assuming $f_n(x)$ is uniformly bounded. Let $f(x) = sup_n f_n(x)$.
It is clear that $f(x)$ is not necessarily continuous. For example, $f_n(x) = 1-x^n, D=[0,1]$. But my questions is can $f(x)$ be discontinuous on a set with positive measure? In the example I give above, $f(x)$ is discontinuous at only $x=1$.
Thanks!

REPLY [5 votes]: Given a closed set $E$, define the distance $d(x,E)$ from $x$ to $E$ in the usual way.  Let $K_n$ denote the set of $x$ so that $d(x,E)\ge 1/n$.  Observe that the set $K_n$ is closed and disjoint from $E$. 
Urysohn's Lemma now says that there is a continuous function $f_n:\mathbb{R}\rightarrow[0,1]$ which is 0 on $K_n$ and 1 on $E$.  The infimum over $f_n$ is then simply the characteristic function of $E$.  To translate this to a supremum, simply observe that $\sup (-f_n)=-\inf(f_n)$
Now you merely need to concern yourself with producing a closed set $E$ whose boundary has positive measure.  This can be done using a Cantor-type construction, as mentioned in the comments.