The tamagotchi craze with the connection series started when I was in fifth grade. My friends and I (surprisingly, in hindsight, I've realized most were guys with tamagotchis) would bring our tamagotchis to school and connect them during recess. My V3 was once taken away by my fifth grade teacher because she thought I was playing with it when my hand got stuck inside my desk. She had it for six months, and it hadn't been paused at the time. When I got it back at the end of the school year, I discovered she had raised and bred several more generations of tamagotchis! Incidentally, I revived my V3 the other day, and a bunch of my friends' tamas from 7 years ago were still in the friends list.
None of my teachers say anything about tamas now because they're too busy with people playing with laptops, iPhones, etc., since the tamas don't have internet or anything.
My advice:
Keep the sound off, for the love of all things good.
Check between classes.
Pretend you're checking the time on your phone, if people at your school do that a lot.
Lots of purses and backpacks have hidden inside pockets the right size for storing some of the older tamagotchis. Lots of people keep valuables in those pockets, so it would look less suspicious.
Don't look at it or check it during tests. (DUH!!)
Avoid checking it in classes where you have strict teachers.
If teachers give you time to work on homework in class, put it in between notebooks or binders you're using and half work, half take care of your tama.