Solution (source code)

= Solution

Set $h(x)=f(x)-yx$. Then
$$
h'(a)=f'(a)-y\leq0,
\qquad h'(b)=f'(b)-y\geq0.
$$
The <extreme value theorem> gives a minimum of $h$ on $[a,b]$. If it occurs in $(a,b)$, the two-sided difference quotient gives $h'(c)=0$. If it occurs at $a$, either $h'(a)=0$ or a negative right derivative contradicts minimality; the endpoint $b$ is analogous. Hence some $c\in[a,b]$ satisfies
$$
\boxed{f'(c)=y}.
$$
This proves the <Darboux theorem for derivatives> in the stated case without assuming that $f'$ is continuous.

Because a differentiable function is continuous, define
$$
F(x)=f(x)+\int_a^x f(t)\,dt.
$$
The <fundamental theorem of calculus> gives $F'(x)=f'(x)+f(x)$. At the endpoints,
$$
F'(a)=f'(a)+f(a)\leq f'(a)\leq y,
$$
while
$$
F'(b)=f'(b)+f(b)\geq f'(b)\geq y.
$$
Applying the result just proved to $F$ yields $d\in[a,b]$ with
$$
\boxed{f'(d)+f(d)=y}.
$$