Let h(x)=f(x)−x, so we have
h(h(x)+g(x)+x+2y)=2h(y).(1)
Hence for every x,y,z∈R+ we have
h(h(x)+g(x)+x+2y)=2h(y)=h(h(z)+g(z)+z+2y).(2)
There exist some x,z∈R+ such that T=h(x)+g(x)+x−h(z)−g(z)−z is positive. Otherwise h(x)+g(x)+x must be constant. So
h(x)+g(x)+x=h(1)+g(1)+1⇒h(x)=−g(x)−x+C,
where C=h(1)+g(1)+1 (constant). By definition of h(x) we get
f(x)=−g(x)+C.
But coefficients of g(x) all are positive, therefore g(x)→+∞ as x→+∞ so g(x)>C for large values x, which contradicts the assumption that f(x)∈R+ for every x∈R+. Therefore function h(x) is periodic because according to equation (2) for each x,z∈R+, T=h(x)+g(x)+x−h(z)−g(z)−z is a period for h. (We can choose x,z∈R+ such that T>0.) Therefore
S(x)=h(x+T)+g(x+T)+(x+T)−h(x)−g(x)−x=g(x+T)−g(x)−T.
S(x) is a period for h for every x∈R+. Since g(x) is a polynomial of degree at least two, S(x) is not constant and is a function of x such that its image contains all numbers greater than a fixed positive real number A and this implies that h(x) is constant for every x∈R+ and so h(x)=K for some constant K. Now we replace function h by K in (1)
h(h(x)+g(x)+x+2y)=2h(y)⇒K=2K⇒K=0⇒h(x)=0∀x∈R+⇒f(x)=x∀x∈R+.