Let $I\subseteq\mathbb{R}$ be a closed interval, and let $f:I\rightarrow\mathbb{R}$ be a function which is such that for every closed subinterval $D\subseteq I$, $f$ satisfies the intermediate value theorem on $D$.
This does not guarantee continuity of $f$, as we can see with $\sin(1/x)$ on any closed interval containing $0$.
Question: How badly discontinuous can $f$ be? Is there a sense in which $f$ is "close" to be continuous?
Let $X\subseteq I$ be the set of points where $f$ is not continuous. Is $X$ small in some sense? Perhaps $X$ is finite, or $X$ has measure $0$?