Post · 3 min read· pp. 105–107
A function f:R→R is said to be continuous if the preimage of any open set is open. Analogously, we might say that a function is measurable if the preimage of a measurable set is measurable. This is a generalization of the more standard defintions of a measurable function: "f:R→R is measurable if for any a∈R the set f−1((a,∞))={x∈R:f(x)>a} is measurable," or equivalently, "f is measurable if the preimage of a Borel set is an open set."
It's not hard to show that if {fn:R→R} is a sequence of measurable functions, then supnfn, infnfn, limsupnfn and liminfnfn are also measurable functions*. But here the analogy between continuity and measurability breaks down. It is not true that if each fn is a continuous function, then supnfn, infnfn, limsupnfn and liminfnfn are continuous as well.
Below is a counterexample (which is not as bad as it looks!) - we have a sequence of functions {fn:[0,1]→[0,1]}, each of which is continuous, yet supnfn is not!
(Counter)Example
Fix x∈[0,1]. For each n∈N define

I know this looks like a hot mess! But it's not bad at all. The graph of each fn consists of the four lines which connect (0,0), (1/(n+1),0), ((2n+1)/(2n(n+1)),1), (1/n,0) and (1,0), in that order. Or to put it simply,
- fn forms a triangle centered at 2n(n+1)2n+1 and has a base of width n(n+1)1
- the right base point of fn+1 equals the left base point of fn
- fn(0)=0 for all n
Here's what the first 3 functions look like:

Let x∈[0,1]. Clearly each fn is continuous. We claim g(x)=sup{fn(x)} is not. Indeed, for each k∈N let
xk=2k(k+1)2k+1 (the value of
x when
fn is at its peak) and observe that
k→∞limxk=0. Assuming to the contrary that
g(x) is continuous, we must have
k→∞limg(xk)=g(0).
On the right hand side, we have
g(0)=supn{fn(0)}=0 since
fn(0)=0 for all
n. But on the left hand side, for a fixed
k∈N, we see that
g(xk)=sup{fn(xk)}=1 since
\begin{align*}
f_n(x_k)=\begin{cases} 1, &\text{if
n=k}\
0, &\text{if
n=k.}
\end{cases}
\end{align*}
This implies that
1=k→∞limg(xk)=g(0)=0
which is, of course, a contradiction.

Footnotes:
* Here's the proof that supnfn and limsupnfn are measurable: Fix a∈R and let g=supfn (i.e. for a fixed x∈R, g(x)=supn{fn(x)}). We claim
g−1((a,∞])=n=1⋃∞fn−1((a,∞]). If this is true, then indeed the function
g is measurable since we can express
g−1((a,∞]) as a countable union of measurable sets. To prove the claim, notice that
x∈g−1((a,∞]) if and only if
g(x)>a if and only if
supn{fn(x)}>a if and only if
fn(x)>a for some
n. And this last bit is true if and only if
x∈⋃n=1∞fn−1((a,∞]).
To see that limsupfn is measurable, suppose we have proved that, for any measurable fn, the function inffn is measurable (the proof is very similar to the previous paragraph). Write
limsupfn=n≥1infk≥nsupfk and let
gn=supk≥nfk. By above, we know each
gn is a measurable function, and so by assumption
infngn -- and hence
limsupfn -- is measurable.
By letting h=inffn and claiming h−1([∞,a))=⋃n=1∞fn−1([−∞,a)), one can use similar techniques to show that inffn and liminffn are measurable.