I've come across this question:
It is given that $f(x)$ is a function defined on $\mathbb{R}$, satisfying $f(1)=1$, and for any $x$ in $\mathbb{R}$, $f(x+5) \ge f(x)+5$, and $f(x+1) \le f(x)+1$. If $g(x)=f(x)+1-x$, find $g(2002)$.
My workings were to look for $f(2002)$. From $f(2) \le f(1)+1=2, f(3)\le f(2)+1\le 3,$ ..., I get $f(2002) \le 2002$, then I'm not sure how to carry on with the problem using the $f(x+5) \ge f(x)+5$ inequality. Is there any way that I could somehow combine the two inequalities to evaluate $f(2002)$? Thank you.
We have $f(x+5)\le f(x+4)+1 \le f(x+3)+2\le f(x+2)+3 \le f(x+1)+4 \le f(x)+5$ using the second property. But by the first property $f(x+5) \ge f(x)+5$. Thus, it must happen that $f(x+1)=f(x)+1, f(x+5)=f(x)+5$. Using a simple induction argument, we can say that $f(n)=n-1+f(1)=n \quad \forall \quad n \in \mathbb{N}$. Hence $$g(n)=n+1-n=1 \implies g(2002)=1$$