Please Check my Calculation for any mistake. Question(T/F).Let $f:[0,\infty)\rightarrow\mathbb{R}$ be a continuous function such that $\lim_{x\to\infty}f(x)=0,$ then function $f$ has a maximum value in $[0,\infty).$
According to me answser is true as $\lim_{x\to\infty}f(x)=0,$ will imply that $|f(x)|\leq\epsilon$ for $x\geq K$ and again $f$ being continuos on compact set $[0,K]$ will attains its bounded. So $f$ must attain its maximum value. So according to  me answer is true. But in answer key it is given false answer. Please suggest me . Thanks in advance. 

It is true that $f$ is bounded, since the bound will be given by the maximum between $\epsilon$ and whatever bound it attains in $[0,K]$.
However, what is definitely not true, is that this maximum needs to be attained. Consider $-e^{-x}$, it clearly approaches $0$ as $x \to \infty$ however it is non-zero at every point.
