I am trying to prove the following exercise, which is a part of a project type homework problem. Please give hints and suggestions, and discuss this problem.
Let $(T,d)$ be a compact metric space, and let $\mathcal{X}$ be a Banach space over the field $\mathbb{K}$. Let $f: T \rightarrow \mathcal{X}$ be a continuous function. Call a function, $g$, "nice" if $g$ has the form,
\begin{equation} g_{n}(t) = \sum_{i=1}^{n} c_{i}(t) \mathcal{x_{i}}, \end{equation} $c_{i}(t)$ is a continuous function in the Banach space $\mathcal{C}_{\mathbb{K}}(T)$ and $\mathcal{x}$ is in $\mathcal{X}$. Prove that there exists a sequence of "nice functions", $\{f_{n}\}_{n\in\mathbb{N}}$ such that $f_{n} \rightarrow f$ uniformly.
Here's my partial attempt:
Let $N \in \mathbb{N}$. Since $f$ is continuous and $T$ is compact, the range of $f$, $R(f)$, is compact as well. Cover $R(f)$ as follows,
\begin{equation} R(f) \subset \bigcup_{x \in R(f)} B(x, 1/N). \end{equation}
Since $R(f)$ is compact, there exists a $n_{N} \in \mathbb{N}$ such that
\begin{equation} R(f) \subset \bigcup_{i = 1}^{n_{N}} B(x_i, 1/N). \end{equation}
Taking inverse images, we have,
\begin{equation} T \subset \bigcup_{i = 1}^{n_{N}} f^{-1}(B(x_i, 1/N)) := \bigcup_{i = 1}^{n_{N}} U(t_i), \quad f(t_i) = x_i, \end{equation}
generating a covering of $T$ by open sets as $f$ is continuous. Replace the open covering for $T$ by a disjoint covering as follows:
\begin{equation} U^{'}_{i} = U(t_i) \setminus \bigcup_{i = 1}^{n_{N} - 1} U(t_i), \quad U(t_0) = \emptyset. \end{equation}
Define $c^{'}_{i}(t) = \chi_{U'(t_{i})}$, and define,
\begin{equation} f_{n}(t) = \sum_{i=1}^{N_{n}} c^{'}_{i}(t) = x_{i} \chi_{U'(t_{i})} x_{i}. \end{equation}
Clearly, one has,
\begin{equation} \lvert \lvert f_{n}(t) - f(t) \rvert \rvert_{\mathcal{X}} < 1/N, \quad \; \text{for all} \; t \in T. \end{equation}
Letting $N \rightarrow \infty$ one can approximate $f$ uniformly.
However, the functions $c_{i}(t)$ have to be continuous functions, and not characteristic (simple) functions. If this approach is correct, how does one go about rectifying it? I think maybe the $c_{i}'s$ should be approximate continuously using something like Uryhson's Lemma for compact metric/Hausdorff spaces etc. but I can't get my hand on the argument.