Solution (source code)

= Solution

Let
$$
h(x)=f(x)-x.
$$
The function $h$ is <continuous function>[continuous], with
$$
h(0)=f(0)\geq0,
\qquad
h(1)=f(1)-1\leq0.
$$
The <intermediate value theorem> gives $c\in[0,1]$ such that $h(c)=0$, and hence $f(c)=c$. This proves the <fixed-point property of a closed interval>.

Now suppose $0,1\in f([0,1])$. For any $y\in[0,1]$, choose $a,b\in[0,1]$ with $f(a)=0$ and $f(b)=1$. Applying the intermediate value theorem to $f$ on the interval with endpoints $a,b$ gives a point $x$ with $f(x)=y$. Thus $f$ is a <surjective function>.