Munafiq is the person who behaves like a Muslim, although he/she is not a believer.
We behave them according to how they describe themselves, which is their apparent side.
The Prophet (p.b.u.h.) had performed as the imam in the funeral prayer of Abdullah B. Ubayy, who is the head of the Hypocrites.
The Glorified Allah commands:
“That is because they first believed, then covered up their belief. Then a new structure formed in their heart, so that they no longer understand.
When you look at them, the forms of their bodies please you; and when they speak, you listen to their words. They are as pieces of timber propped up. They think that every cry is against them. They are the enemies; so beware of them. May Allah destroy them! How are they mislead to lie!” (Al-Munafiqun/ The Hypocrites 63:3-4)
But if their hypocrisy is apparent, that is revealed, then we have the duty of bewaring of them.
The Glorified Allah commands as follows for some hypocrites whose real faces He reveals:
“And do not perform the funeral prayer (salat) for any of them who has died – ever – or stand at his grave. Indeed, they disbelieved in Allah and His Messenger and died while they were sinners.” (At-Tawbah/ The Repentance 9:84)