I am trying to prove the following statement, but I have been stuck for a while and I am looking for an hint about how to prove it:
"Suppose $B\subset\mathbb{R}$ and $f:B\to\mathbb{R}$ is an increasing function. Prove that $f$ is continuous at every element of $B$ except for a countable subset of $B$."
What I have tried to do:
Since I wasn't able to tackle the original statement I tried by assuming that $B$ is also a Borel set so as to exploit in some way the fact that $f$ must then be a Borel measurable function. Then if $D:=\{x\in B: f\text{ is not continuous at }x\}$ and $C$ is a Borel set we have that $f^{-1}(C)$ is a Borel set and $f^{-1}(C)=(f^{-1}(C)\cap D)\cup (f^{-1}(C)\cap B\setminus D)$ and at this point I tried to go on by contradiction, assuming that $D$ is uncountable and tried to show that $(f^{-1}(C)\cap D)\cup (f^{-1}(C)\cap B\setminus D)$ is not a Borel set but I haven't succeeded so I would greatly appreciate any hint or comment or explanation that could nudge me towards a more fruitful approach, thanks.
EDIT (Proof): Let $D:=\{x\in B:f\text{ is not continuous at }x\}$: since $f$ is monotone (increasing) it can only have jump discontinuities so if $d\in D$ then $I_d:=(\lim\limits_{x \to d^-,\ x\in B\\}f(x),\lim\limits_{x \to d^+,\ x\in B}f(x))=(\sup_{x<d,\ x\in B}f(x),\inf_{x>d,\ x\in B} f(x))$ is a non-empty interval in $\mathbb{R}$ hence there must be a rational number $q_d$ in it which we can choose and since $I_d\cap I_{d'}=\emptyset$ for $d\neq d'$* this rational number is also unique so we can define an injective function $g:D\to\mathbb{Q}, g(d):=q_d$. Thus $\#(D)\leq \#(\mathbb{Q})=\#(\mathbb{N})$ ie the set of points at which $f$ is discontinuous is (at most) countable, as desired. $\square$
(*) Suppose $I_d\cap I_{d'}\neq\emptyset$ for some $d\neq d'$ (we can suppose wlog that $d<d'$): then there must be $y\in I_d\cap I_{d'}$ so $\sup_{x<d,\ x\in B}f(x)<y<\inf_{x>d,\ x\in B}f(x)$ and $\sup_{x<d',\ x\in B}f(x)<y<\inf_{x>d',\ x\in B}f(x)$ which implies (since $d\leq d'\Rightarrow \inf_{x>d,\ x\in B}f(x)\leq \sup_{x<d', x\in B}f(x)$) that $y<y$, contradiction.
Let $B:=(-\infty,-1]\cup [1,\infty).$
– tchappy ha Mar 20 '23 at 09:29Let $f$ be a function such that $f(1)=1$ and $f(-1)=-1$ and $f(x)=x+1$ if $1<x$ and $f(x) =x-1$ if $x<-1$.
Then, $\inf {f(x):x\in B,-1<x}=1>-1=\sup {f(x):x\in B, x<1}.$