# Pointwise sup of step functions is lower semicontinuous (a.e.)

I've found this problem while I was reading a paragraph about Riemann integration on some notes a mate gave me a long time ago.

Let $f \colon [a,b] \to \mathbb R$ be a bounded function. Suppose there exists a sequence of step functions $f_k$ s.t. $$f(x)=\sup_{k \in \mathbb N} f_k(x) \quad \forall x \in [a,b]$$ Show that $f$ is lower semicontinuous in $[a,b]\setminus C$ where $C$ is a at most countable subset.

The problem seems quite easy: indeed, the pointwise sup of a family of lower semicontinuous functions is still semicontinuous (it's just a consequence of topology axioms, intersection of closed sets is closed). In other words, if $x$ is a point in which $f_k$ is l.s.c. for every $k \in \mathbb N$ so is $f$.

But what about the set $C$? Initially, I thought that the points of $C$ were the points of "jump" for $f_k$ (for some $k \in \mathbb N$). But is it true that a step function is not lower semicontinuous in a "jump" point? Is the problem clear? Hope so.

The confusion might lie in what is meant by "step function." It is possible to have step functions that are lower semicontinuous, upper semicontinuous, or neither. For instance, if $f_k\colon[0,1]\to \mathbb{R}$ is the function $$f_k(x) = \begin{cases} 1-\frac{1}{k} & x\in[0,1/2].\\ 0 & x\in (1/2,1].\end{cases}$$ for each $k$, then the $f_k$ are upper semicontinuous, and their supremum is the function $f$ which is $1$ on $[0,1/2]$ and $0$ on $(1/2,1]$. This $f$ is upper semicontinuous but not lower semicontinuous. However, $f$ is lower semicontinuous on $[0,1]\smallsetminus \{1/2\}$.