problem involving continuity and sequences. Please, help me to solve this problem.
$f\colon[a,b] \rightarrow \mathbb R$ continuous and $ \forall n, \exists x_n \in [a,b]$, such that
 $|f(x_n) - x_n|< \frac{1}{n}$. Prove that $ \exists x \in [a,b]$ such that $f(x)=x$.

The obvious thing to do is consider the sequence $(x_n)_{n\in\mathbb N}$. Since this sequence is bounded, it has a subsequence that converges to some $x_\infty$. Since $[a,b]$ is closed, this limit $x_\infty$ is also in $[a,b]$. Assume $f(x_\infty)\ne x_\infty$. Then find a term $x_n$ of the subsequence converging to $x_\infty$ with $\frac1n<\frac12|f(x_\infty)-x_\infty|$ and $|x_n-x_\infty|<\frac12|f(x_\infty)-x_\infty|$ to arrive at a contradiction.
