Closure of Injective and Surjective Sets in $C([0,1]\rightarrow [0,1])$ Consider the space of all continuous functions from $[0,1]$ to $[0,1]$ equipped with the $\sup$ metric. Is the set of all injective functions in this space closed? What about the set of all surjective functions?
 A: The sequence $f_n(x)=\frac{x}{n}$ is made up of injective functions and converges to a non-injective function. So the set of injective functions is not closed. 
On the other hand, the set of surjective functions is closed. This is due to the following argument: a sequence $f_n$ of surjective continuous functions is characterized by the fact that $\min f_n=0, \max f_n=1$. If $f_n\to f$ uniformly on $[0,1]$, then $$\max f_n = \|f_n\|_\infty \to \|f\|_\infty=\max f $$ (trivial - here we use the fact that $f_n\ge 0$) and $$\min f_n\to \min f$$ (less trivial - proof below). Therefore $f$ is surjective. 
Proof of $\min f_n\to \min f$. 
Consider a sequence $x_n\in [0,1]$ such that $f_n(x_n)=\min f_n$. Pass to a convergent subsequence $x_{k(n)}\to x_0$ and let $n\to \infty$ in the inequality 
$$
f_{k(n)}(x_{k(n)})\le f_{k(n)}(x),\qquad x\in [0,1].$$
This shows that $f(x_0)=\min f$. Now use a "subsequence of subsequence" trick. Reasoning as before, you see that every subsequence of $\min f_n$ admits a subsequence that converges to $\min f$. Therefore, the whole sequence $\min f_n$ converges to $\min f$.
A: Injective functions are not closed: there are many examples but Giuseppe's example is very simple and nice.
For surjective functions, note that if $f_n$ is a sequence of surjective functions converging uniformly to a limit $f$, then $f$ is necessarily continuous, and since $[0,1]$ is compact it follows that $f([0,1])$ is also compact, so that $f([0,1])=[m,M]$ where $m,M$ are minimum and maximal value of $f$ on $[0,1]$. Suppose $M\neq 1$. Then
$$
||f_n-f||_{\infty}=\sup_{[0,1]} |f_n-f| \ge 1-M \not\to 0
$$
and similarly for $m$. So by contradiction $M=1$, $m=0$
