This question has been inspired by the answers and comments received on this sister question.
Let $I\subseteq\mathbb R$ be a non-degenerate closed (but not necessarily bounded) interval. Suppose that $f:I\to\mathbb R$ is a function with a closed graph. This means that the set $\{(x,f(x))\,|\,x\in I\}$ is a closed subset of $\mathbb R^2$.
It is clear to me (see, for example, here) that if $f$ is also assumed to be bounded, then it must be continuous. However, continuity is not guaranteed without boundedness. For example, if $I=[0,1]$ (a compact interval) and $f:[0,1]\to\mathbb R$ is defined as\begin{align*}f(x)\equiv\begin{cases}\dfrac{x}{1-x}&\text{if $x\in[0,1)$,}\\0&\text{if $x=1$,}\end{cases}\end{align*}then $f$ has a closed graph but it is discontinuous at $x=1$. More complicated examples can be constructed with a greater number of discontinuities.
My question is twofold:
Is there a characterization of how pathological $f$ can be? (Admittedly, this question is vague, so interpret it freely.)
In particular, I conjecture (but could neither prove nor come up with a counterexample) that $f$ must be of Baire class 1—that is, it must be a pointwise limit of continuous functions. Is this conjecture true?
Any guidance regarding these questions would be greatly appreciated.