i do see the problem of my previous proof. It is wrong. Now i propose a new proof. For each x in A, define the continuous map f_x:X->[0,1], such that f_x(x)=0, f_x(B)={1}. Also define the set C_x=f^(-1)([0,1/2)) which is open. Therefore union of C_x, x belong to A, contains A. By compactness of A, there exists a finite subcover, indexed by C_1, …, C_n. Index the corresponding map by f_1,…,f_n. Now define f=min.{f_1,…,f_n} Then f is a continuous map from X to [0,1], and for every x belong to A, f(x) belong to [0,1/2), since x belong to C_k for some k=1,…n. Moreover, f(B)={1}. Then define map g:X->[0,1] by g(x)=f(x), if f(x) belong to [1/2,1] and g(x)=1/2, if f(x) belong to [0,1/2) By pasting lemma, g is continuous. Moreover, g(A)={1/2} and g(B)={1}. Then g is such a continuous map that separates A and B. Q.E.D._________________Few, but ripe.
—- Carl Friedrich Gauss