Theorem 8.15: If $f$ is a continuous and $2\pi$-periodic function and if $\epsilon>0$ is fixed, then there exists a trigonometric polynomial $P$ such that $$\left|P(x)-f(x)\right|<\epsilon$$ for all real $x$.
Proof: If we identify $x$ and $x+2\pi$, we may regard the $2\pi$-periodic functions on $\mathbb{R}^1$ as functions on the unit circle $T$, by means of the mapping $x\rightarrow e^{ix}$. The trigonometric polynomials, i.e., the functions of the form $$Q(x)=\sum^N_{-N} c_ne^{inx}\qquad(x\mbox{ real})$$ form a self-adjoint algebra $\mathscr{A}$, which separates points on $T$, and which vanishes at no point of $T$. Since $T$ is compact, the Stone-Weierstrass theorem tells us that $\mathscr{A}$ is dense in $\mathscr{C(T)}$. This is exactly what the theorem asserts.
I have already seen the proof of this theorem discussed in the site, however I have never found a satisfactory explanation of the passages omitted by Rudin (more advanced tools are usually used to answer the existing questions but that does not help). I have tried proposing my attempt at a proof, however I immediately realized it was flawed (it implied the map $z \to e^{ix}, x \in [0,2\pi[$ to be continuous).
I think that Rudin is being a little too much elliptic here. In fact, I interpreted his first statement as "we can define a continuous function g on $S^1$ such that: $$g(z) = f(x), \hspace{5mm} \text{$x$ is the unique element of $[0,2\pi[$ such that $z=e^{ix}$ "}$$ and then the rest of the proof proceeds smoothly. My problem is that there is a non-trivial property of $g$ that must be proved in order to make use of the Stone-Weierstrass Theorem, that is, $g$ is continuous. Rudin doesn't even acknowledge that and I did not manage to prove that it is actually continuous so far. Therefore I am not even sure that this is the right interpretation of what is written.
If someone could give me some guidance that would be very appreciated!