Convergence function to bounded function I saw many times in maths this trick:
If for two functions f and g with the same domain $[0,+\infty)$ we have $f(x)\leq g(x), \ \forall x\geq 0$ and if $$\lim_{x\to +\infty} g(x)=l\in R $$ then
f is bounded to $[0,+\infty)$. I cannot understant why this is true!! I believe that f will be bounded at some neighbourhood of $+\infty$. Is there any further condition that it hides behind this claim?May be some monotone hypothesis for g?
 A: As a counterexample:

Take the function $f(x)=\frac{1}{x}$ if  $x \in (0,1]$ and $f(0)=0$ and $f(x)=1 \forall x \geq 1$ and $g(x)=f(x)$ on $[0,1]$ and $g(x)=2$ on $[1,+\infty]$

Also again for continuous functions,as a counterexample.

take $f(x)=-x$ on $(-\infty,0]$ and $f(x)=\frac{x}{x^2+1}$ on $[0,+\infty]$
Now take $g(x)=f(x)$ on $[0,1]$ and $g(x)=\frac{x^2}{x^2+1}$ on $[1,+\infty]$

So the statement in general is not true.
If,for instance, $f$ is continuous and non-negative on $[0,+\infty)$ or bounded from bellow, then it is true.

Indeed, by hypothesis exists $M>0$ such that $g(x) \leq M$ on an interval $[b,+\infty]$ thus $f \leq M$ on $[b,+\infty]$
Also on $[0,b]$ we have that $f$ is bounded above by continuity by a number $L$
Thus $f(x) \leq \max\{M,L\}$
Since $f$ is assumed non-negative or bounded from  bellow then it is bounded on $[0,+\infty]$

A: As you say, $f$ is bounded (above) in some neighborhood of $\infty$, say on $(a,\infty)$. 
By continuity of $f$ (which you indicated in a comment is assumed) it is also bounded on the compact set $[0,a]$. 
To include more details, say $f(x)\le A$ for all $x>a$, and $f(x)\le B$ whenever $0\le x\le a$. Let $C=\max\{A,B\}$. Then $f(x)\le C$ for all $x\ge0$. 
(To conclude that $f$ is bounded, you perhaps also assume that $0\le f$? Otherwise take $g=0$, $f(x)=-x$.) 
