Is it illegal to write a song with key signature double sharps and flats?
There are no laws that prohibit the use of any specific key signatures in music composition. Key signatures with double sharps and flats are perfectly legal and valid, although they are somewhat rare. They can be used to create certain musical effects or to accommodate instruments with unusual tuning requirements.