There exists a differentiable function for which $f'\left(x\right)=\begin{cases} \frac{\cos x-1}{x^{2}} & x\ne0\\ 1 & x=0 \end{cases}$ Prove or disprove: There exists a differentiable function for which $$f'\left(x\right)=\begin{cases} \frac{\cos x-1}{x^{2}} & x\ne0\\ 1 & x=0 \end{cases}$$
My way:
False. Assume towards a contradiction that there exists such function.
Then we have:
$$f'\left(0\right)=1$$ $$f'\left(2\pi\right)=0$$
By Darboux's theorem, there exists $$0<c<2\pi$$ such that:
$$f'\left(c\right)=\frac{1}{2}$$
Thus:
$$f'\left(c\right)=\frac{1}{2}=\frac{\cos c-1}{c^{2}}\Rightarrow$$ $$\cos c=1+\frac{c^{2}}{2}>1$$
Contradiction!
.
My question is - would it been easier to disprove by integrating and trying to find the original function?
Even if not, could I see the shortest method on this case please?
Thank you.

Your proof looks perfectly fine, great job!
The function given for $f'(x)$ has a removable discontinuity at $x=0$. There's a theorem in analysis stating that the derivative of a differentiable function can't have removable or jump discontinuities. But if you look at a typical proof of this theorem, it's pretty much the same argument as your solution here — such a proof would either refer to Darboux's Theorem or would reproduce the Intermediate Value Theorem argument that lies behind Darboux's Theorem.
So short of stating that "there's a theorem for this", your solution is the best approach, imho.
