<s>[INST] Find $g(2002)$ given $f(1)$ and two inequalities 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)\geq f(x)+5,$$
$$f(x+1)\leq f(x)+1.$$
If $g(x)=f(x)+1-x$ then find $g(2002)$.
Here,
$$f(x+5)\leq f(x+4) +1,$$
I didn't get any idea..
 [/INST] Rewriting the given inequalities in terms of $\,f(x)=g(x)+x-1\,$:
$$\require{cancel}
\begin{align}
f(x+5)\geq f(x) + 5 \quad&\iff\quad g(x+5)+\bcancel{x}+\cancel{5}- \xcancel{1} \ge g(x) + \bcancel{x} -\xcancel{1} + \cancel{5} \\
 &\iff\quad g(x+5) \ge g(x) \\
f(x+1)\leq f(x)+1 \quad&\iff\quad g(x+1)+\bcancel{x}+\cancel{1}- \xcancel{1} \le g(x) + \bcancel{x} -\xcancel{1} + \cancel{1} \\
 &\iff\quad g(x+1) \le g(x) \\
\end{align}
$$
It follows that $\,\color{blue}{g(x)} \ge g(x+1) \ge g(x+2) \ge g(x+3) \ge g(x+4) \ge g(x+5) \ge \color{blue}{g(x)}\,$, so equalities must hold throughout, then $\,g(x+1)=g(x)\,$, and $\,g(2002)=g(2001)=\ldots =g(1)\,$.
</s>