Let f:R→R be continuous and let S={x∈R:f(x)=0} be the set of all roots of f. Prove that S is a closed set.

How would you prove the above using the following: Let f : D→R be continuous at a point a∈D,and assume f(a)>0. Prove that there exists a δ > 0 such that f (x) > 0 for all x ∈ D ∩ (a − δ, a + δ).

I know I would need to use problem 2 to show that the compliment of S is open but Im not sure how.