Subrings need not be ideals, but every ideal in c(S) is a subring.
If T is a subset of S, the functions that vanish on T (mapping T to 0) form an ideal. If T is a single point p, the quotient map is isomorphic to R, a field, hence the ideal is maximal.
Assume S is compact, and W is a subring that separates points. Let W′ be the closure of W in c(S). Now W′ could be all of c(S). If not, it is the ideal that vanishes on a particular point p.
Suppose every point p has some function fp in W that does not vanish on p. Each function determines an open set Op that keeps fp near fp(p), and away from 0. Finitely many open sets cover S, so let f be the sum of the squares of these finitely many functions. Note that f is nowhere 0.
Since S is compact f(S) is closed and bounded. Suppose the image lies in [u,v]. We have seen that the polynomials approximate any continuous function uniformly. Define a continuous function on [0,v] that consists of two line segments. One slopes from the origin up to u,1, and the next runs horizontally from u,1 to v,1. Choose a polynomial approximation within ε/2, hence the constant term has absolute value below ε/2. Drop the constant and find a polynomial within ε of this function, hence it is within ε of 1, over the domain [u,v]. Since W is a linear space and a ring, we can compose f with this polynomial to find a function that is everywhere within ε of 1. A sequence of functions approaches 1, and 1 is in W′. Since W′ is a ring, W′ = c(S).
Failing this, assume all the functions of W vanish on p, for a particular point p, hence all the functions of W′ vanish on p. We need to show all the functions that vanish on p are in W′. Let V be the ring generated by W and the constant functions. The members of W can already be scaled by R, so V is actually the direct sum of W and the constant functions. Now let f be any function that vanishes on p. Remember that V separates points, and it has the constant functions, hence V′ = c(S). The functions of V approximate f uniformly. The approximations that are within 1 of f must have constant term 0, to approach f(p) = 0. Therefore all the approximating functions actually come from W. A function vanishes on p iff it belongs to W′.
Note that W′ does not vanish on some other point q, because W separates points, so something in W maps p to 0 and q to a nonzero value. The functions of W′ are precisely those functions that vanish on p.
In summary, if W is a subring that separates points, W′ = c(S), or W′ is the set of continuous functions that vanish on p.
If M contains the function described earlier, that is everywhere nonzero, multiply by its inverse to get 1. Therefore M has no such function, and M vanishes on at least one point; call it p. Bring in every function that vanishes on p and find a possibly larger ideal. But there is no larger ideal, hence M is the set of functions that vanish on p.
In summary, maximal ideals correspond to the points of S.
Of course S is not usually discrete. Let S be [0,1], and build a multiplicatively closed set consisting of all the nonzero polynomials in x with real coefficients. Drive 0 up to a prime ideal P missing these polynomials. Suppose P is maximal, the functions that vanish on a certain value u. Yet x-u vanishes on u, so this is a contradiction. There are many prime ideals that are not maximal.