Subset of continuous functions that are not surjective is open (with sup metric) I have the following proposition:
"Let $C$ be the set of continuous functions $f:[a,b] \rightarrow [a,b]$ with the sup metric. The subset of $C$ made by taking the continuous functions that  are not surjective is open."
I've managed to prove this, but by using results from complete metric spaces:


*

*proved that $C$ with the sup metric is complete;

*proved that the subset of $C$ made by taking the continuous functions that are surjective is complete;

*proved that a complete subspace of any metric space is closed;

*finished by using that a set is open if its complement is closed.


What I'm looking for is a simpler proof, a less "complete" proof.
My idea: I thought about again proving that the subset of $C$ taking the surjective functions is closed. Maybe using that every continuous function in $f:[a,b] \rightarrow [a,b]$ is bounded. How can I go from that (if at all)?
 A: Let $f$ be non-surjective; without loss of generality, $f$ maps into $[a,b']$ with $b' < b$. Let $\epsilon = \frac{b - b'}2$. Then the open ball of radius $\epsilon$ around $f$ is contained in the non-surjective functions, since no such function can map onto $b$.
This implicitly uses the fact that the continuous image of a compact set is compact, since we have to rule out that the image of $f$ is e.g. $[a,b)$.
A: Suppose $f$ is not surjective, then there is some non empty open $U$ such that
$f([a,b]) \cap U = \emptyset$. This exists because $f([a,b])$ is compact 
and hence closed.
Pick some $y \in U$, then there is some $\epsilon>0$ such that
$B(y,2\epsilon) \subset U$.
Now suppose $\|f-g\|_\infty < \epsilon$. Then $g(x) \notin B(y,\epsilon)$ for all $x$.
Hence the range of each function in $B_\infty(f,\epsilon)$ does not intersect $B(y,\epsilon)$ and hence is not surjective.
A: Show that the sets of all surjective continuous function is closed in $C.$
let $\{f_{n}\}_{n \in N}$ be a sequence of surjective functions in $C$ which is convergent to some $g$ in $C$ (w.r.t sup norm). show that $g$ is surjective:
pick $y \in [a,b]$ then for each $n \in N$ there exist $x_n \in [a,b] $ such that $f_{n}(a_n) = y$. WLOG we may assume $a_n \rightarrow x \in [a,b]  $, and  since $f_n$ is uniformly convergent  to $g$ then $f_n(a_n)  \rightarrow g(x)$ which implies $g(x) =y.$
