You will see, and they will see, which of you is afflicted with madness.
then it means, `you will know, O Muhammad -- and those who oppose you and reject you, will know -- who is insane and misguided among you.'
This is like Allah's statement,
سَيَعْلَمُونَ غَداً مَّنِ الْكَذَّابُ الاٌّشِرُ
Tomorrow they will come to know who is the liar, the insolent one! (54;26)
Allah also says,
وَإِنَّأ أَوْ إِيَّاكُمْ لَعَلَى هُدًى أَوْ فِى ضَلَـلٍ مُّبِينٍ
And verily (either) we or you are rightly guided or in plain error. (34;24)
Ibn Jurayj reported from Ibn Abbas, it means
"You will know and they will know on the Day of Judgement."
Al-`Awfi reported from Ibn `Abbas;
بِأَييِّكُمُ الْمَفْتُونُ
Which of you is Maftun (afflicted with madness) means which of you is crazy.
This was also said by Mujahid and others as well.
The literal meaning of Maftun is one who has been charmed or lured away from the truth and has strayed from it. Thus, the entire statement means,
`so you will know and they will know,'
or `you will be informed and they will be informed, as to which of you is afflicted with madness.'
And Allah knows best.
Then Allah says,
إِنَّ رَبَّكَ هُوَ أَعْلَمُ بِمَن ضَلَّ عَن سَبِيلِهِ وَهُوَ أَعْلَمُ بِالْمُهْتَدِينَ