Every space satisfying the conclusion of Urysohn's Lemma satisfies the conclusion of the Tietze Extension Theorem I'm trying to prove the following statement which is a part of a question in Folland's Real Analysis (exercise 24 of chapter 4; p.124).

If $X$ satisfies the conclusion of Urysohn's Lemma, then $X$ satisfies the conclusion of Tietze Extension Theorem.

So far I take $A$ as a closed subset of $X$ and $f \in C(A,[0,1])$. I know that I'm looking for $F \in C(X,[0,1])$ whose restriction to $A$ is $f$. By assumption, considering $A$ and the null set $\emptyset$ we have $g \in C(X,[0,1])$ such that $g=0$ on $A$ (or $g=1$ on $A$, whichever works). However, now I'm stuck here.
Can somebody give me a hint?
 A: Extended HINT: It’s easier to work with continuous functions to $[-1,1]$, so suppose that $f:A\to[-1,1]$ is continuous. Let 
$$L_1=\left\{x\in A:f(x)\le-\frac13\right\}$$
and
$$R_1=\left\{x\in A:f(x)\ge\frac13\right\}\;;$$
these are disjoint closed sets in $X$, so there is a continuous $g_1:X\to\left[-\frac13,\frac13\right]$ such that $g_1(x)=-\frac13$ for $x\in L_1$, and $g_1(x)=\frac13$ for $x\in R_1$. Let $f_1=f-g_1$; $|f(x)-g_1(x)|\le\frac23$ for all $x\in A$, so $f_1$ maps $A$ continuously to $\left[-\frac23,\frac23\right]$.
Now repeat the procedure: split the interval $\left[-\frac23,\frac23\right]$ in thirds (at $-\frac29$ and $\frac29$), let
$$L_2=\left\{x\in A:f(x)\le-\frac29\right\}$$
and
$$R_2=\left\{x\in A:f(x)\ge\frac29\right\}\;,$$
and use the Uryson property to get a continuous $g_2:X\to\left[-\frac29,\frac29\right]$ such that $g_2(x)=-\frac29$ for $x\in L_2$, and $g_2(x)=\frac29$ for $x\in R_2$. Let $f_2=f_1-g_2$, and note that $|f_1(x)-f_2(x)|\le\frac49=\left(\frac23\right)^2$ for all $x\in A$, so $f_2$ maps $A$ continuously to $\left[-\left(\frac23\right)^2,\left(\frac23\right)^2\right]$.
Given $f_n:A\to\left[-\left(\frac23\right)^n,\left(\frac23\right)^n\right]$, split the interval in thirds (at $-\frac{2^n}{3^{n+1}}$ and $\frac{2^n}{3^{n+1}}$), let
$$L_{n+1}=\left\{x\in A:f(x)\le-\frac{2^n}{3^{n+1}}\right\}$$
and
$$R_{n+1}=\left\{x\in A:f(x)\ge\frac{2^n}{3^{n+1}}\right\}\;,$$
and use the Uryson property to get a continuous $g_{n+1}:X\to\left[-\frac{2^n}{3^{n+1}},\frac{2^n}{3^{n+1}}\right]$ such that $g_{n+1}(x)=-\frac{2^n}{3^{n+1}}$ for $x\in L_{n+1}$, and $g_{n+1}(x)=\frac{2^n}{3^{n+1}}$ for $x\in R_{n+1}$. Let $f_{n+1}=f_n-g_{n+1}$, and note that $|f_n(x)-f_{n+1}(x)|\le\left(\frac23\right)^{n+1}$ for all $x\in A$, so $f_{n+1}$ maps $A$ continuously to $\left[-\left(\frac23\right)^{n+1},\left(\frac23\right)^{n+1}\right]$.
Now let
$$F:X\to[-1,1]:x\mapsto\sum_{k\ge 1}g_k(x)\;,$$
and prove that $F$ is continuous and that $F\upharpoonright A=f$. It’s helpful to note that for any $n\in\Bbb Z^+$,
$$f(x)=f_n(x)+\sum_{k=1}^ng_k(x)\;,$$
and hence
$$\sum_{k=1}^ng_k(x)=f(x)-f_n(x)\;.$$
