Solution:
Write P(x)=(x−z1)(x−z2)…(x−z2023), where z1,…,z2023 are the roots of P. Note that P(1)=1 is equivalent to (1−z1)(1−z2)…(1−z2023)=1. Furthermore, by Vieta, z1+z2+…+z2023=0. This gives us the two equations
(1−z1)+(1−z2)+…+(1−z2023)(1−z1)⋅(1−z2)⋅…⋅(1−z2023)=2023=1
By observing that
20231⋅i=1∑2023(1−zi)=(i=1∏2023(1−zi))20231
and using the equality case of AM-GM (which can be applied since 1−zi>0 for all i), we deduce that z1=z2=…=z2023=0. Therefore, the only solution is P(x)=x2023. This polynomial obviously satisfies the desired properties.