TITLE: Function composition for proving polynomials are continuous
QUESTION [5 upvotes]: I am attempting to prove that polynomials $\mathbb{R} \to \mathbb{R}$ are continuous in the topological sense. Let $f$ be such a polynomial.
The answer here suggests showing that linear functions are continuous (easy) and that the composition of continuous functions is continuous (easy).
However - and perhaps it's because I've been looking at this stuff too long - I fail to see why
$$\begin{align}
p_0(x) &= a_n \\
p_1(x) &= xp_0(x) + a_{n-1} \\
p_2(x) &= xp_1(x) + a_{n-2} \\
&\vdots \\
p_n(x) &= f(x)
\end{align}$$
is, per the answer in the question, "just composing a linear function with a continuous function."
From my perspective, $p_0$ is a constant function, so it's continuous.
Let's suppose I have a function $g: \mathbb{R} \to \mathbb{R}$ given by $g(y) = cy + d$ for some $c, d \in \mathbb{R}$ fixed. I have shown that $g$ is continuous.
If I assume $c = x$ and $d = a_{n-1}$, then I get $g(p_0(x)) = xp_0(x) + a_{n-1}$.
However, while setting $d = a_{n-1}$ seems like fair game (they are both constants), $x$ is definitely not a constant, so I don't feel comfortable setting $c = x$.
Am I missing something here?

REPLY [3 votes]: As MPW says in the comments, the quoted answer is wrong; it is treating $x$ as a constant which it, of course, is not. An approach that will work and is, to my mind, the conceptual and straightforward thing to do here, is the following: prove that addition and multiplication
$$+, \times : \mathbb{R} \times \mathbb{R} \to \mathbb{R}$$
are continuous, that the diagonal map
$$\Delta : X \ni x \mapsto (x, x) \in X \times X$$
is continuous, and that if $f : X \to Y, g : Z \to W$ are two continuous functions, then their product $f \times g : X \times Z \to Y \times W$ is continuous.
Using these facts (and that composition of continuous functions is continuous), prove that if $f(x), g(x) : X \to \mathbb{R}$ are two continuous functions, then their pointwise sum $f(x) + g(x)$ and pointwise product $f(x) g(x)$ are continuous. Now starting from the constant and identity functions $\mathbb{R} \to \mathbb{R}$ and repeatedly taking pointwise products and sums you get exactly the polynomials.