best adhesive for foam
This looks like normal EVA foam, which is often used in the cosplay community for making lightweight armour and the like (and of course for kneeling pads, children's play areas and the like).

I've successfully made prop helmets from EVA foam using contact adhesive to join the edges - they held up well despite the tension through the join. Given that you'll have a much greater surface area and much less tension on the join you'll have no trouble with it.

An alternative glue, widely used in the cosplay community, is barge cement, however I haven't used it so cannot personally confirm it's usefulness.