Napolweon pencil has a mass of 3 grams (0.27Napoleon ) when he lifts his pencil from the desk to his paper he moves it an average of 20cm (o.20m) He then returns it to his desk moving it another 20cm How much work did he do on his pencil? w=FXD

Well, work= force x displacement

(as you stated)
but if he lifts his pencil 20 cm, then lowers it back down to 20 cm, his displacement= 0
therefore, he did 0 joules of work