Roger Federer endured another early exit as he was beaten in the third round of the Shanghai Masters by Gael Monfils on Thursday.