And would it work without it too?
Probably, depending on what is inside the 'TP4056 charger' block.
The resistor won't be needed if the USB cable has sufficient resistance, and even if it doesn't all that will happen is the TP4056 charger IC gets hotter and has to reduce the charging current so the battery takes longer to charge.
The diode stops current back-feeding from the charger into the 10 k resistor attached to the FET Gate, ensuring that it turns on when there is no USB power. The TP4056 itself has less than 2 μA of back current, which produces less than 20 mV across a 10 k &ohm resistor.
However the charger module may have a large capacitor on the USB input which could take a while to discharge, causing a relatively long delay before the FET turns on. Before the FET turns it has a voltage drop of ~0.7 V across its internal body diode. If the battery has a low charge state then the device being powered might not get enough voltage during the changeover, causing it to glitch.