Prove that if $f(x)$ has a least upper bound $M$ then for every $\epsilon\gt 0$ there exists an $\bar{x}$ in the domain of $f(x)$ such that $|f(\bar{x})-M|\lt\epsilon$.

Problem: 

Prove that if $f(x)$ has a least upper bound $M$ then for every $\epsilon\gt 0$ there exists an $\bar{x}$ in the domain of $f(x)$ such that $|f(\bar{x})-M|\lt\epsilon$.

Answer: