>>82368903They're called "防犯ブザー", which literally translates into "(security) buzzer" and it emits a loud noise when activated.
Very young children carry them in case they are in danger, like a suspicious adult approaching or touching them. The most common use is protection against sexual assault.
The perpetrator leaves the crime scene when he hears the sound due to being scared.
Some schools hand them out for free and some also have GPS function.
It's used to tease lolicon (pedophiles) in fiction or to accentuate a fictional character's young age.
Osaka Police has an article on it:
https://www.police.pref.osaka.lg.jp/seikatsu/kodomo_jyosei/10/4141.htmlThey recommend children and women to carry it as self defence method.