How to construct a continuous function from a non compact metric space to R that is unbounded?

15 Views Asked by At

There is a theorem that states that every continuous function from a compact metric space to R is bounded however, the converse is not true, but I am not sure how to construct such a function. My idea is to start with a countable subcover that has no finite subcover. Since we can enumerate each subcover U1, U2, U3..., I was thinking of mapping each element in the subcover equal to its index, but I'm not sure if this function is continuous.