# If, $\lim x_n$ exists and finite then there is a function $f$ that is continuous

Suppose that $\lim x_n=L<\infty$. Then show there exists a continuous function $f:[0,1]\to \mathbb{R}$ where $f(1/n)=x_n$.

I'm not sure how exactly to go about this. What I thought about saying is that if we define $f(1/n)=x_n$ for small $n$ and $f(1/n)=f(0)$ if $n$ is large. Then I think this would make $f$ continuous but I'm a little unsure. Any help would be great. Thanks!

Define $f$ by $f(1/n)=x_n$, $f(0)=L$ and $f$ be piecewise linear between $1/n$ and $1/(n+1)$. $f$ is continuous in $0$ since $\lim f(1/n)=f(\lim 1/n)$ and is also continuous in every other point by construction.
i.e. if you want $f(1/n)$ to take values $x_n$ and to be continuous, simplys define between $\frac{1}{n+1}$ and $\frac{1}{n}$: $$f(x) = (x - \frac{1}{n+1})x_{n} + (\frac{1}{n} - x)x_{n+1}$$
Then you should be able to verify that by defining $f(0)$ as $L$, $f$ is continuous everywhere!
Let $g(x) = x_nt + (1-t)x_{n+1}$ for $n \leq x < n+1$ and $t=x-n$. Then let $f(x) = g(\frac 1 x)$ if $x>0$ and $f(0) = \lim x_n$.
Obviously $g$ is continuous on $\mathbb{R}\setminus\mathbb{N}$. Also $g$ is continuous on $\mathbb{N}$ since the limit from the right and the left are the same for all $n \in \mathbb{N}$, so $g$ is continuous. Then also $f$ is continuous on $(0,1]$. To prove the continuity of $f$ in $0$ use $x_n \to f(0)$ for $n \to \infty$.