If the deceased person is very close to the child, yes of course.
Also if the child expresses the desire to do so.
It is a way to share the sadness of the whole family, to be together.
The child may participate in its own way during the ceremony ; lay a flower on the coffin, and -if he knows how to read - share a prayer. Beforehand, someone has taken the time to explain what exactly is going to happen , and the meaning of the ceremony.
On the other hand, bring the child to the cemetery and to the burial is not advised.