Show that $C(I, R)$ has a countable dense subset, and therefore a countable basis

Give $R^I$ the uniform metric, where $I = [0, 1]$. Let $C(I, R)$ be the subspace consisting of continuous functions. Show that $C(I, R)$ has a countable dense subset, and therefore a countable basis.

I know to show that having a countable dense subset implies having a countable basis.

I'm doing this exercise in Munkres book and got no clue about the solution. Hope someone can help me solve this.

Hint Given in the Book is...Consider those continuous functions whose graphs consist of finitely many line segments with rational end points.

• Do you know the Weierstraß approximation theorem (or the more general Stone-Weierstraß theorem)? – Daniel Fischer Sep 19 '15 at 14:34
• In my book, there is a hint: "Consider those continuous functions whose graphs consist of finitely many line segments with rational end points." – Eclipse Sun Sep 19 '15 at 14:36
• Yah the statement of the theorem I know...but which version is reqd here? – user8795 Sep 19 '15 at 14:37
• "Show that $C(I,R)$ has a countable dense subset, and therefore a countable basis.": Do you mean that there is a countable basis for the topology on $C(I,R)$, or a basis for $C(I,R)$ in the vector-space sense? It's true that $C(I,R)$ has a countable basis in the second sense, but it's not as simple as "has a countable dense subset, therefore"; there are spaces with countable dense subsets but no countable basis. If otoh you meant basis for the topology then never mind (although you probably should have explained that's what you meant). – David C. Ullrich Sep 19 '15 at 14:45

1) Prove that linear combination of a finite number of $\chi_{[a,b)}$ with $a<b$ in $I$ are dense. Here I would use uniform continuity.
2) Prove that you can take the intervals of the above linear combination in $\mathbb{Q}$ instead that in $\mathbb{R}$.
3) Prove that you can take the coefficients of the combination in $\mathbb{Q}$ instead that in $\mathbb{R}$.