Assume that the metric space $(X, d)$ is not compact. Show that there exists $f: X\to \Bbb R$ which is continuous but not bounded.
The only function in my mind is $f: X\to \Bbb R$ defined by $f(x)=\|x\|$. I know this function is continuous. I don't know if it is bounded or not. I need a hint how to choose this function.