Let $\mathbb{R}_{\geq 0}$ denote the set of nonnegative real numbers. Find all functions $f: \mathbb{R}_{\geq 0} \rightarrow \mathbb{R}_{\geq 0}$ such that, for all $x, y \in \mathbb{R}_{\geq 0}$,

$$
f\left(\frac{x+f(x)}{2}+y\right)=2 x-f(x)+f(f(y))
$$

and

$$
(f(x)-f(y))(x-y) \geq 0
$$
The only solution is $f(x)=x$. It clearly works. Note that (3) is a disguised way of saying $f$ is increasing (i.e. $x \leq y$ implies $f(x) \leq y$ ).

We claim that $f(x) \geq x$ for all $x$. If $f(x)<x$ for some $x$, let $y=\frac{x-f(x)}{2} \geq 0$ in (2). Then

$$
\begin{aligned}
f(x) & =2 x-f(x)+f\left(f\left(\frac{x-f(x)}{2}\right)\right) \\
& \geq 2 x-f(x) \\
2 f(x) & \geq 2 x \\
f(x) & \geq x
\end{aligned}
$$

a contradiction. So $f(x) \geq x$.

We next find the value of $f(0)=c \geq 0$ by plugging various pairs $(x, y)$ into (2). From $(c, 0)$ we get

$$
f\left(\frac{c+f(c)}{2}\right)=2 c-f(c)+f(c)=2 c
$$

since $f(c) \geq c$ and $f$ is increasing, we get $f(c) \leq 2 c$. But from $(0,0)$ we get

$$
f(c / 2)=-c+f(c)
$$

since $f(c / 2) \geq f(0)=c$, we get $f(c) \geq 2 c$. So equality holds: $f(c)=2 c$ and $f(c / 2)=c$. Finally, $(0, c / 2)$ gives

$$
2 c=-c+2 c
$$

that is, $c=0$.

To complete the proof, plug $y=0$ into $(2)$ to get

$$
f\left(\frac{x+f(x)}{2}\right)=2 x-f(x)
$$

so

$$
2 x=f(x)+f\left(\frac{x+f(x)}{2}\right) \geq x+\frac{x+f(x)}{2} \geq x+\frac{x+x}{2}=2 x .
$$

Equality holds everywhere, so $f(x)=x$.