max value of function on set suppose $X =\{1,2,\dots\}$ and $\displaystyle g(x)= 1-\frac{1}{x}$. My question is why max $g(x)$ does not exist ? $x$ here belongs to $X$. My only explanation that $g(x) = 1$ when substitute $x$ with one and also when substitute $x$ with large numbers such as 10000 and more.
 A: At $x=1$ $g(1)=0$ which is indeed the minimum of $g$, that in this case exists. For the maximum you have to be careful and not confuse it with the supremum. 1 is indeed the supremum, but since it does not come from any value $x\in X$ it is not the maximum.
A: For sure :

$$\lim_{x\rightarrow\infty}g(x) = 1$$

but for every $M \in X = \{ 1,2,… \}$ you can choose, "big" as you want, you always have that : 


$$g(M)= 1-\frac{1}{M} < g(n)= 1-\frac{1}{N}$$


for all $N > M$.
In other words, assume that there exists $M \in X$ such that $g(M)$ attains its maximum. Then choosing $N = M+1$ (clearly $N \in X$), we have that :


$$g(N)= 1-\frac{1}{M+1} > g(M)= 1-\frac{1}{M}$$


Contradiction !
A: Given a set of real numbers, it has a maximum if the least upper bound of the set is an element of the set. Note that there is no $x\in X$ such that $g(x)=1$, because $\frac1x>0$ so $g(x)=1-\frac1x<1$.
So while $1$ is an upper bound, and in fact the least upper bound, it is excluded from being a maximum (or a maximal element) because it is not a member of the set $\{g(x)\mid x\in X\}$.
