TITLE: Supremum over dense subset of banach space
QUESTION [5 upvotes]: Let $\{x_n\}$ be a countable dense subset of a Banach space $X$. How can I show that
$$\sup_{x \in X}f(x) = \sup_{n \in \mathbb{N}}f(x_n)$$
where $f$ is continuous and real-valued??

REPLY [5 votes]: For a continuous function, you always have $f(\overline{A}) \subset \overline{f(A)}$. So in your situation, you have
$$f(X) = f\left( \overline{\left\lbrace x_n : n \in \mathbb{N} \right\rbrace}\right) \subset \overline{f\left(\lbrace x_n : n \in \mathbb{N}\rbrace \right)}.$$
Now use the fact that
$$\sup \overline{B} = \sup B$$
for all $B\subset \mathbb{R}$.