I assume you mean extruded PIR (Polyisocyanurate) board rather than polystyrene? Common brand names being Celotex and Kingspan. I have to say, it isn't the first material that comes to mind for shelves.
A solvent-free grab adhesive will work. My favourite is Screwfix No Nonsense brand: https://www.screwfix.com/p/no-nonsense-grab-adhesive-solvent-free-white-310ml/87451
(Blimey. I'm glad I have plenty in stock. Last time I bought some, less than two years ago, it was half that price!)