<s>[INST] Proving that if $(x_n) \to x$ then $p(x_n) \to p(x)$ in Real Analysis I am self-learning Real Analysis from Stephen Abott's Understanding Analysis. Exercise 2.3.8 asks to prove that when a polynomial function $p$ is applied to values of a convergent sequence $(x_n)$, then if the input sequence converges to $x$, the resulting sequence converges to $p(x)$.
Questions.
(a) Do you guys think, my proof of part (a) is technically correct and rigorous?
(b) For part (b), should I just construct any function, such that the function value is different from the limiting value?

Let $(x_n) \to x$ and let $p(x)$ be a polynomial.
(a) Show $p(x_n) \to p(x)$.
(b) Find an example of a function $f(x)$ and a convergent sequence $(x_n) \to x$ where the sequence $f(x_n)$ converges, but not to $f(x)$.

Proof.
$\newcommand{\absval}[1]{\left\lvert #1 \right\rvert}$
(a) We are given that $(x_n) \to x$, so we can make the distance $\absval{x_n - x}$ as small as we like. Suppose $p(x) = x^{k}$ where $k$ is a non-negative integer.
Observe that,
\begin{align*}
 \absval{p(x_n) - p(x)} &= \absval{x_n^k - x^k}\\
 &= \absval{(x_n - x)(x_n^{k-1} + x_n^{k-2}\cdot x + \ldots + x_n \cdot x^{k-2} + x^{k-1})}\\
\end{align*}
Also,
\begin{align*}
\tiny
 \absval{(x_n^{k-1} + x_n^{k-2}\cdot x + \ldots + x_n \cdot x^{k-2} + x^{k-1})} &\le \tiny \absval{x_n^{k-1}} + \absval{x_n^{k-2}\cdot x}  + \ldots + \absval{x_n \cdot x^{k-2}} + \absval{x^{k-1}}\\
 \tiny\frac{1}{\absval{x_n^{k-1}} + \absval{x_n^{k-2}\cdot x}  + \ldots + \absval{x_n \cdot x^{k-2}} + \absval{x^{k-1}}} &\le \tiny\frac{1}{\absval{(x_n^{k-1} + x_n^{k-2}\cdot x + \ldots + x_n \cdot x^{k-2} + x^{k-1})}}
\end{align*}
Now, there exists $N_1$ such that $\absval{x_n - x} < \frac{\absval{x}}{2}$ for $n \ge N_1$. If the distance between $x_N$ and $x$ is smaller than $\frac{\absval{x}}{2}$, then clearly $\absval{x_n} > \frac{\absval{x}}{2}$.
Thus,
\begin{align*}
 \frac{1}{k\cdot \frac{\absval{x^k}}{2^{k-1}}} &< \frac{1}{\absval{(x_n^{k-1} + x_n^{k-2}\cdot x + \ldots + x_n \cdot x^{k-2} + x^{k-1})}}\\
 \implies \frac{2^{k-1}}{k \cdot \absval{x^k}}&< \frac{1}{\absval{(x_n^{k-1} + x_n^{k-2}\cdot x + \ldots + x_n \cdot x^{k-2} + x^{k-1})}}
\end{align*}
There exists $N_2$ such that $\absval{x_n - x} < \epsilon \cdot \frac{2^{k-1}}{k \cdot \absval{x^k}} $ for all $n \ge N_2$.
Let $N = \max \{N_1,N_2 \}$. To show that this $N$ indeed works, we prove that:
\begin{align*}
 \absval{p(x_n) - p(x)} &= \absval{(x_n - x)(x_n^{k-1} + x_n^{k-2}\cdot x + \ldots + x_n \cdot x^{k-2} + x^{k-1})}\\
 &< \epsilon \cdot \frac{2^{k-1}}{k \cdot \absval{x^k}} \cdot \absval{(x_n^{k-1} + x_n^{k-2}\cdot x + \ldots + x_n \cdot x^{k-2} + x^{k-1})} \\
 &< \epsilon \cdot \frac{1}{\absval{(x_n^{k-1} + x_n^{k-2}\cdot x + \ldots + x_n \cdot x^{k-2} + x^{k-1})}} \cdot \absval{(x_n^{k-1} + x_n^{k-2}\cdot x + \ldots + x_n \cdot x^{k-2} + x^{k-1})} \\
 &= \epsilon
\end{align*}
for all $n \ge N$. Thus, $p(x_n) \to p(x)$.
By algebra of limits, any linear combination of the powers of the sequence $(x_n)$ must be convergent and $\lim p(x_n) = p(x)$.
 [/INST] If you are using the algebra of limits in the end of your proof, you might as well use it in the beginning. Considering $p(x)=a_0 + a_1 x + \cdots + a_k x^k$, you have that
$$
\lim p(x_n) = \lim(a_0 + a_1 x_n + \cdots + a_k x_n^k)= a_0 + a_1 \lim x_n + \cdots + a_k (\lim x_n)^k = p(x).
$$
</s>