Solution by Maximilian113.
Let P(x,y) denote f(x(1+f(y)))=(1+y)f(x). Taking x=0 gives f(0)=0. Clearly f≡0 works, so assume f≡0. If f(a)=f(b), then comparing P(x,a) and P(x,b) for some x with f(x)=0 gives (1+a)f(x)=(1+b)f(x), hence a=b. Thus f is injective. Now P(x,−1) gives f(x(1+f(−1)))=0=f(0), so injectivity gives f(−1)=−1. Therefore P(−1,y) gives f(−1−f(y))=−1−y. Define g(t)=1+f(t−1). Multiply x by (1+f(z)) to get f(x(1+f(y))(1+f(z)))=(1+y)(1+z)f(x). Letting w=y+z+yz, we also have f(x(1+f(w)))=(1+y)(1+z)f(x). By injectivity, 1+f(w)=(1+f(y))(1+f(z)), so g((1+y)(1+z))=g(1+y)g(1+z). Hence g(ab)=g(a)g(b) for all a,b∈R. Moreover, f(−1−f(y))=−1−y becomes g(1−g(t))=1−t. We have g(0)=0, g(1)=1, and g(−1)=−1. If t>0, writing t=u2 gives g(t)=g(u)2>0, so g preserves signs. Therefore g(1−g(t))=1−t implies g(t)>1⟺t>1. Multiplicativity now shows that g is strictly increasing. Every increasing multiplicative function on R>0 has the form g(t)=tα for some α>0: indeed, h(u)=logg(eu) is increasing and additive, hence h(u)=αu. Substituting into g(1−g(t))=1−t gives (1−tα)α=1−t for 0<t<1. Thus t1−α=tα1−(1−tα)α→α as t→0+, which is possible only when α=1. Hence g(t)=t for all t, so f(x)=g(x+1)−1=x. Therefore the solutions are f(x)≡0 and f(x)=x.