Prove or disprove that $$f(x)= \begin{cases} \sin(\frac{1}{x}) & \text{for $x \neq 0$} \\ \frac{1}{2} & \text{for $x=0$} \end{cases}$$
has an antiderivative in $\mathbb{R}$.
This function satisfies the Darboux's property, but how to say definitely that admits an antiderivative?
It doesn't have an antiderivative. Let$$g(x)=\begin{cases}\sin(\frac{1}{x}) & \text{ if $x \neq 0$} \\0 & \text{ if $x=0$.}\end{cases}$$Then $g$ has an antiderivative. So, if $f$ had one, $f-g$ would have an antiderivative too. But $f-g$ doesn't satisfy the Darboux property.
In order to see why $g$ has an antiderivative, consider the function$$h(x)=\begin{cases}x^2\cos\left(\frac1x\right)&\text{ if }x\neq0\\0&\text{ if }x=0.\end{cases}$$Then$$h'(x)=\begin{cases}2x\cos\left(\frac1x\right)+\sin\left(\frac1x\right)&\text{ if }x\neq0\\0&\text{ if }x=0.\end{cases}$$But the function$$x\mapsto\begin{cases}2x\cos\left(\frac1x\right)&\text{ if }x\neq0\\0&\text{ if }x=0\end{cases}$$is continuous and therefore has an antiderivative. Therefore, $g$ has an antiderivative too.