# $C[X,R]$ a closed subspace of $B[X,R]$

Is there any condition for $$X$$ to be a compact space in the theorem "Space $$C[X,R]$$ is a closed subspace of $$B[X,R]$$? Because I see that if $$X$$ is not compact then $$C[X,R]$$ does not become a subset of $$B[X,R]$$. Counterexample is that $$X=(0,1)$$ is a metric space with usual metric and is not compact. If I define $$f(x)=1/x$$ on $$X$$, then it is continuous but not bounded.

If you are defining $$C[X,\mathbb R]$$ as the space of all continuous functions on $$X$$ then this space is not a subset of $$B[X,\mathbb R]$$ in general. If $$X$$ is compact then $$C[X,\mathbb R]$$ is a subset of $$B[X,\mathbb R]$$. Assuming that $$X$$ is a metric space, then the converse is also true: if $$C[X,\mathbb R]$$ is a subset of $$B[X,\mathbb R]$$ then $$X$$ is compact.