Limit of sequence Prove that: $$\lim_{n \to \infty} f(a_n) = f \left(\lim_{n \to ∞} a_n\right).$$ 
where $a_n \to x_0$ as $n \to \infty$, and $f$ is continuous at $x_0$.
My thought: If we prove that $\lim_{n \to \infty} f(a_n) = \infty$ and somehow prove the same for the other one.
 A: Your thought is wrong. For example, if $a_n = \frac1n$ and $f(x) = \sin x$, then you cannot prove that $\lim_{n\to\infty}f(a_n) = \infty$, because that is simply not true.
That said, here is a Hint:


*

*Write down the definition of when the limit of $a_n$ is equal to $L$.

*Write down the definition of when $f$ is continuous at $x_0$.


Compare the two definitions. They look very similar.
Now, 


*

*Write down what you have to prove.

*Write down what you know.


Look at what you wrote and start thinking very hard.
A: The idea is that if a function is continuous, you can switch the limit and the f operators.
It's clear that the RHS is $f(x_0)$. All that remains is to show that the limit of the sequence of functions $f(a_1), f(a_2), \dots$ is $f(x_0)$. Use the definition of the limit:
$\forall \epsilon > 0, \exists N \in \mathbb{N}$ s.t. $|f(x_0) - f(a_n)| < \epsilon$ whenever $n > N$
Definition of continuity of $f(x)$ at $x_0$:
$\forall \epsilon > 0, \exists \delta > 0$ s.t. $|f(x) - f(x_0)| < \epsilon$ whenever $|x - x_0| < \delta$
Guess:
Try something like $|f(x) - f(x_0)| = |f(x) - f(a_n) + f(a_n) - f(x_0)|$
$\le |f(x) - f(a_n)| + |f(a_n) - f(x_0)| < \epsilon/2 + \epsilon/2 = \epsilon$
