The angle made by the incident ray with the normal of the line x+y = 1 is equal to the angle made by the reflected ray with the normal. The line x+y=1 makes 45° angle with the coordinate axes while the line x=1 is perpendicular to the x-axis.
Clearly, the incidence ray makes 45° angle with the normal at P. So, the reflected ray will also make the same angle with the normal. Consequently, it is along x axis i.e., y = 0.