Darboux theorem states that the intermediate value property of every bounded derivative on $[a,b]$. Since every continuous function on closed interval $[a,b]$ must be a derivative of some functions, it must have the intermediate value property.
I wonder if there exists a sufficient and necesary condition for functions to have the intermediate value property.
PS: I have considered the Riemann function on $[0,1]$,$$R(x)=\begin{cases}\frac 1q & \text{if}\; x=\frac pq ,\;p,q\in \Bbb N\\0 & \text{if}\; x \; \text {is irrational}\end{cases} $$
which does not have the intermediate value property (for example $0\le R(x) \le 1$, but $\forall x \in [0,1], R(x)\ne \frac {\sqrt 2}2$). Can I use the Darboux's theorem to prove that there is no primitive of $R(x)$ although it is Riemann integrable?