In the current days of COVID-19, one of the items in high demand is face masks. After all, a virus that transmits through droplets and attacks the lungs, would be best kept out if your nose and mouth are covered.
While the N95 face mask is touted as having good filtering efficiency, the commonly available face masks are not fool-proof. This means that they are not a guarantee against the virus, but they obviously would offer some protection to you (if you are well), and to others (if you are unwell), rather than nothing at all.
Face masks are an integral part of Japanese life. It is common to see people of all ages, on the streets and on public transport, wearing a mask if they have a cold or cough. It is not so much for themselves as for the people they come in contact with. The intention is not to pass whatever infection they have to anyone else.