# Supremum over dense subset of banach space

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??

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}$.

• Thanks but I end up getting $\sup_{x \in X}f(x) \leq \sup_n f(x_n)$. I need the result $\sup \overline{f(\{x_n\})} = f(X)$ I think. Oct 22, 2013 at 15:28
• You have $\sup\limits_{n\in\mathbb{N}} f(x_n) \leqslant \sup\limits_{x\in X} f(x)$ anyway, since all $x_n \in X$. Then $\sup\limits_{x\in X} f(x) \leqslant \sup\limits_{n\in\mathbb{N}} f(x_n)$ is just what you need to conclude equality. Oct 22, 2013 at 15:33
• Of course! Thanks!!! Oct 22, 2013 at 15:34