It is well known that a function $f:[a,b]\to\mathbb R$ which has the intermediate value property (i.e. if $a',b'\in[a,b]$, then for each $c$ between $f(a')$ and $f(b')$ there is some $x$ between $a'$ and $b'$ such that $f(x)=c$) cannot have jump discontinuities, and that a function $g:[a,b]\to\mathbb R$ of bounded variation can only have jump discontinuities. Therefore, a function having the intermediate value property and being of bounded variation must be continuous. I wonder if the BV-condition can be relaxed a little, so my question is:
Is there a discontinuous function $f:[a,b]\to\mathbb R$ and a function $g:[a,b]\to\mathbb R$ of bounded variation, such that $f$ has the intermediate value property and agrees with $g$ at every point of $[a,b]$ except at countably many?
Any hints/help is highly appreciated. Thanks in advance!