Let $X$ be a compact metric space, and let $B(X)$ be the set of real-valued bounded functions on $X$. For any $f, g ∈ B(X)$, define $$d_B(f, g) :=\sup _{x\in X}\left | f(x)-g(x) \right |$$ Suppose, we already know $(B(X),d_B)$ is a metric space.
Prove that $B(X)$ is a complete metric space.
My idea (Using the compactness of $X$.)
Since $X$ is a compact metric space, any sequence $x_n$ in $X$ must converge to some point $a$ in $X$ because $X$ is sequentially compact.
Then, for any function $f$ in $B(X)$, $f(x_n)$ will converge to $f(a)$.
Thus, any sequence $f(x_n)$ converges to some constant function in $B(X)$.
Hence, $B(X)$ is a complete metric space.
But, I am not sure if this idea works to prove the statement because I didn't even use a condition of Cauchy sequence.
I guess that if $f\in B(X)$, then $f:X\to \mathbb R$. Moreover, the compactness of $X$ looks not important. Let $(f_n)$ be a Cauchy sequence. Since $f_n(x)$ is a Cauchy sequence for all $x$, it will converges to some $f(x)$. Let $\varepsilon >0$. Since $(f_n)$ is a Cauchy sequence, there is $N\in\mathbb N$ s.t. for all $x\in X$,
$$|f_N(x)-f_{N+r}(x)|<\varepsilon .$$ Taking $r\to \infty $ gives $$|f_N(x)-f(x)|<\varepsilon,$$ for all $x\in X$. Finally, if $x\in X$, $$|f(x)|\leq |f_N(x)-f(x)|+|f_N(x)|\leq \varepsilon +\sup_{x\in X}|f_N|<\infty .$$
Therefore, $f\in B(X)$.