stone weierstrass approximation theorem for simple functions: does it exist? The most general version of the theorem (I have seen) states that a function from a compact metric space into reals can be approximated by an algebra of functions that maps in the same way, is continuous, separates points, is non-vanishing.
I wonder, apologies if the question is trivial (I am not a mathematician), what happens when the function of interest maps from a compact metric space into a finite set consisting of real numbers? I believe such functions are called simple functions (am not sure). 
Is there a version of the theorem for such a case?
What worries me that such mappings look horribly non-continuous, and continuity seems to be a key requirement in all proofs of the theorem I’ve seen.
Note: I need to use the theorem in the way I presented (checkig for algebraic properties, separations property etc). Please try to suggest a similar formulation, if there is such.
An example: Imagine that I want to approximate a function f that takes a series of 100 numbers (each number from an interval [0,1]) and returns +1 if they are sorted, -1 if they are not. This is a complicated function though mathematically it is classified as a simple function (I think): it maps from a compact metric space (100-tuples or reals) into a finite set {-1,1}. At my disposal I have an algebra of functions I can use to carry out the approximation. What do I need to ask about that algebra in order to make sure I can find a good approximation for f? Should I proceede like usual as the SW instructs me to do (check separation property, etc) or do something else?
Best
Zoran
 A: As has been described, you can't uniformly approximate simple functions via continuous functions. Simple functions are, true to name, probably the simplest discontinuous functions, so I wouldn't expect to get a uniform approximation result with other obvious candidates, but if you have a particular algebra in mind do tell us about it.
On the other hand, simple functions can be approximated by polynomials (so certainly by continuous functions) in a looser sense: if $f$ is simple there's a sequence of polynomials $g_n$ converging to it in terms of $\int_X |f-g_n|$. To make this detailed you have to have a finite measure on your metric space, but in some cases (subsets of $\mathbb{R}^n$) there's a reasonably obvious metric associated to the topology. This kind of approximation is good enough for many applications.
A: The uniform limit of a sequence of continuous functions is continuous (at least for functions defined on a closed interval, and the same is probably true on any compact space) is itself continuous, so if you want to approximate all simple functions by continuous functions, you're out of luck.
If you drop the continuity requirement and just try to approximate using functions from some algebra, then the simple functions themselves are an algebra, so the question becomes trivial.
