Suppose $f:]a,b[\to\Bbb R$ is differentiable (possibly $C^1$, $C^2$ or a lot smoother, say $C^\infty$), and define $T=\lbrace(x,y)\mid a<x<y<b \rbrace$. Does there exist a somewhat regular function $$ \theta:T\to]a,b[ $$ such that $$ \forall (x,y)\in T,\quad\frac{f(y)-f(x)}{y-x}=f'(\theta_{x,y}) $$ and say $\theta_{x,y}\in]x,y[$. By "somewhat regular" I mean at least mesurable, but potentially more than that given the right hypothesis on $f$.
There is a continuous global $\theta$ if $f'$ is one to one : since $f'$ has the intermediate value property, $f'$ must be strictly monotone on $]a,b[$ and thus a homeomorphism (and thus $f$ strictly concave or convex), and has , and so is a homeomorphism onto its image. Also there is a local solution around $(x_0,y_0)$ if $f$ is $C^2$, and for some $\theta$ we have $$ \frac{f(y_0)-f(x_0)}{y_0-x_0}=f'(\theta) \text{ and }f''(\theta)\neq 0 $$
Are there globally defined $\theta$ in general?
How regular are such $\theta$ depending on the regularity of $f$?
Are there at least local solutions almost everywhere?