There's a few issues here: Mattresses may have the elements to make good insulation, but as they are they will not do much for you, however if you were able to shred them they would produce a batting insulation with a much higher R value (which means better insulation). Building then into a wall will mean the your wall thickness will be somewhere in the area of about 9"-12", which is incredibly thick for a wall assembly, especially since the R value of a mattress as is will be relatively low. The best method to attack this idea is to rip open the mattresses and remove all metal springs and ribs, then shred the fabric and mix it with fiberglass insulation or whatever materials you desire (really you need another ingredient which has a high R value). Then you can simply use it to fill any voids you have in your wall. Really this is a time consuming method which may produce results that you are not happy with, however this is your best bet if you are looking to make a contribution to recycling with mattresses. An interesting idea though, I'd love to see any data you have and if you go through with it you should definitely post it up here! Good luck!