existence continuous function $f:X\to [0,1]$ such that $f(x_1)=0 , f(x_2)=\frac{1}{2}, f(x_3)=1$

Let $X$ be a Hausdorff normal topological space and $x_1, x_2, x_3$ are three distinct points.prove that there exist continuous function $f:X\to [0,1]$ such that $f(x_1)=0 , f(x_2)=\frac{1}{2}, f(x_3)=1$

I think Urysohn's Lemma will be helpful here.

By Urysohn's Lemma there exists a continuous function $f:X\to [0,1]$ such that $f(x_1)=0 , f(x_3)=1$ and moreover there exists a continuous function $g:X\to [0,1/2]$ such that $g(x_1)=0 , g(x_2)=1/2$. But how can I add them to get a single function?

• Try to use a different closed set, ie $\{x_1,x_2\}$ is also closed. – Kris Williams May 13 '13 at 2:42

By Urysonh's lemma and since $X$ is $T_1$ you can get a continuous $f:X\rightarrow [0,1/2]$ such that $f(x_1)=0,f(x_2)=1/2$ and $f(x_3)=0$; $\{x_1,x_3\}$ is closed, and then $g:X\rightarrow [0,1]$ with $f(x_1)=0,f(x_2)=0$, and $f(x_3)=1$, now you can add these functions.
There are lots of ways of doing this. Given $x_1,x_2, x_3$, there exist functions $f_1,f_2:X \to [0,1]$ such that $f_1(x_1) = 0, f_1(x_2) = 1$, and $f_2(x_3) = 0, f_2(x_2) = 1$. Then $f:X \to [0,1]$ defined by $f(x) = f_1(x)f_2(x)$ satisfies $f(x_1)= f(x_3) = 0$ and $f(x_2) = 1$.
By a similar procedure, we can find a $g:X\to[0,1]$ such that $g(x_1)= g(x_2) = 0$ and $g(x_3) = 1$.
The function $\phi(x) = \frac{1}{2} f(x) + g(x)$ satisfies the requirements.