What is the name and purpose of the following component?
I was wondering what is the name and purpose of the white box component ? It seems to be just a wire with some white body around. Is it a resistor or a fuse ?


It's a resistor, perhaps wirewound.

Look at the PCB where that component is soldered. Its component designator will probably be a number prefixed by "R". In combination with that capacitor C25, this is a "capacitive dropper" from the incoming mains voltage.

You can read more about that type of power supply in this previous question and elsewhere.


  My guess is that 4W22R means 4 watts 22 ohms


Yes.


  How can I test that component is still working ? 


With power completely removed and the capacitors on the PCB discharged, you could try measuring its resistance with a DMM and see if you get a sensible result. Since I expect it to be in series with C25 and no other components in parallel with it, then you should measure 22 ohms +/- 10% 5%

The lack of discolouring gives us no indication of overheating (although doesn't disprove that it has occurred).