Extension to a continuous function of a set of specified values

I was able to prove an extension of the Ham Sandwich Theorem (namely; that given any 3 integrable functions on $\mathbb{R}^3$, there exists a plane which simultaneously divides their total integrals in half), and am attempting to show that this does not carry over to 4 functions. I have reduced the proof to one fact which I think is true; but don't know how to prove. Given two sets of points in $\mathbb{R}^4$, $S$ and $T$, is there a continuous function $f:\mathbb{R}^4\to\mathbb{R}$ which takes the value $a$ on all points in $S$ and $b$ on all points in $T$?

-

Depends on the sets. For example, if you could find a sequence of points in $S$ that converges to a point in $T$, and $a\neq b$, then you would not be able to do so, since the value of $f$ at the limit (that is, $b$), would have to equal the limit of the values (that is, $a$). Or worse, if $S\cap T\neq\emptyset$ (though I suspect you meant the two sets to be disjoint, you failed to mention this).
However, if both $S$ and $T$ are closed and disjoint, then the answer is yes: any two disjoint closed sets in $\mathbb{R}^4$ (in fact, in $\mathbb{R}^n$) can be separated by a continuous function $f\colon\mathbb{R}^4\to \mathbb{R}$ such that $S$ is precisely the set of points that map to $0$, and $T$ is precisely the set of points that map to $1$. From there to your function is an easy step.
(This follows because $\mathbb{R}^4$ is a metric space, and hence perfectly normal. See Wikipedia's page on normal spaces.)
thanks! yes; the two sets are disjoint, and can be chosen so that no point of one is a limit point of the other (they are certain sets of antipodes of $S^3$, so, at least I think I'll be able to choose their division into sets $S$ and $T$ such that if a member of $S$ was a limit point of $T$ then I could place that particular point in $T$ and it's antipode in $S$). –  Steve Feb 10 '11 at 7:54
It is not sufficient that no point of one is a limit point of the other. Consider, for example, (-1,0) and (0,1) in $\mathbb{R}$. However, if you can show that no limit point of one is a limit point of the other, then their closures $\bar{S}$ and $\bar{T}$ are disjoint, so you can apply the theorem cited by Arturo (which, by the way, is often referred to as Urysohn's lemma) to $\bar{S}$ and $\bar{T}$. –  Nate Eldredge Feb 10 '11 at 12:52