To many of your knowledge or surprises, having your earphones in while riding a bicycle is, in fact, illegal in Japan. The police may stop you and give you a fine if they see you doing it.
I learned about that law on my way home from work one day, listening to my favourite music, and the police standing at the street corner signaled me to stop my bike.
"Sir, you can't have your headphones in while riding a bicycle."
Even after I've explained my ignorance, I was given a warning ticket and promised that I'd change.
From that day on, I started riding my bike with only ONE earphone in.
Fast forward a year, I was stopped again. Apparently, ONE earphone is also not okay, and there I got another warning ticket from a different police officer. Lucky for me, I was let off with just a warning, but they had all the rights to fine me for the "dangerous behaviour", so you bicycle riders out there, watch out!