Solution (source code)

= Solution
{c}

If $f$ is a <continuous function>, the <intermediate value theorem> ensures that every value between $f(a)$ and $f(b)$ is attained. <Monotonicity> excludes values outside that range, so $f([a,b])=[f(a),f(b)]$.

Conversely, suppose this equality of <sets> holds. At an interior point, if $f^-(x_0)<f(x_0)$, any $y$ strictly between these two numbers lies in $[f(a),f(b)]$. Yet inputs below $x_0$ have values at most $f^-(x_0)$ and inputs at or above $x_0$ have values at least $f(x_0)$, so no input attains $y$. This contradicts <surjectivity>. The same argument excludes $f(x_0)<f^+(x_0)$, so part (b) gives <continuity> at every interior point.

At $a$, a strict gap $f(a)<f^+(a)$ likewise leaves every value between them unattained; hence $f^+(a)=f(a)$, giving right <continuity>. At $b$, the corresponding argument gives $f^-(b)=f(b)$ and left <continuity>. These are the appropriate endpoint notions on $[a,b]$. Hence
$$
\boxed{f\text{ continuous on }[a,b]\iff f([a,b])=[f(a),f(b)].}
$$