Let $X$ be a Hausdorff space. Then $X$ is normal if and only if for every pair of disjoint closed sets $A,B \subset X$, there exists a continuous map $f: X \rightarrow [0,1]$ such that $f(x) = 0 $ for all $x \in A$ and $f(x)=1$ for all $x \in B$.
($\Rightarrow$) Assuming that $X$ is normal, we have for disjoint closed sets $A$ and $B$ that there exist disjoint open sets $U$ and $V$ such that $A \subset U$ and $B \subset V$. I am thinking that we need to construct a function from $X$ onto $[0,1]$ such that $f(x) = 0 $ for all $x \in A$ and $f(x)=1$ for all $x \in B$ and somehow show that it is continuous using the open sets $U$ and $V$.
($\Leftarrow$) Assume that there exists a continuous map $f: X \rightarrow [0,1]$ such that $f(x) = 0 $ for all $x \in A$ and $f(x)=1$ for all $x \in B$. I am thinking of using the fact that since $f$ is continuous, for any open set $V \subset [0,1]$, we have $f^{-1}(V)$ open in $X$. Then I want to find two open subsets $U$ and $V$ of $[0,1]$ such that $A \subset f^{-1}(U)$ and $B \subset f^{-1}(V)$ and $f^{-1}(U) \cap f^{-1}(V) = \emptyset$. But I am having trouble finding such $U$ and $V$. Any help would be appreciated, thank you!