Let $x_n \to x$ and $y_n \to y$ in $\mathbb R$ such that $x_n \neq x_m, \, \forall n \neq m$.
How can I show the existance of a continuous function $f: \mathbb R \to \mathbb R$ with $f(x_n) = y_n, \, \forall n$ and $f(x) = y$?
I've trying to solving this problem in the last few days, however I didn't have any idea. I'm looking for a hint to solve this question.
Help?
Define $f$ by linear interpolation. Without loss of generality, we may assume that $\{x_n\}$ in increasing. On the interval $[x_n,x_{n+1}]$ define $f$ as $$ f(x)=y_n+\frac{x-x_n}{x_{n+1}-x_n}\,(y_{n+1}-y_n)\text{ and }f(x)=y. $$ On $(-\infty,x_1)$, let $f(x)=y_1$, and on $(x,+\infty)$, let $f(x)=y$.