Shoes and When Not to Wear Them
When entering a house, apartment, school, some restaurants, some hotels, many shrines and temples, a few museums, and a random assortment of other buildings in Japan you can't wear your shoes. Normally there's either a spot right outside the building or a little entry area where you can take off your shoes. These are typically pretty easy to recognize since they're a bit lower than the rest of the building and you need to remove your shoes before stepping up to the higher area (although sometimes it's all flat so you just need to pay attention). Some places have little shoe lockers where you're supposed to put your shoes while at other you just leave them on the floor. And then there’s a few where you’re given a plastic bag in which to carry your shoes (this mainly happens if you’ll be leaving by a different way than you entered.
But just because you take your shoes off doesn't necessarily mean you'll be going around barefoot or in your socks either. On tatami floors (tatami is a floor made up of mats woven out of straw) you can't wear anything other than socks. On other types of floors, little slippers are usually provided for guests to wear. Said slippers vary from place to place but they're usually one size fits all (although sometimes that fit is pretty bad) and can often slip off your foot rather easily if you're not paying attention. Naturally, if you're going from regular floor to tatami there will be a place to take those slippers off and leave them while you're on the tatami. Some places also have bathroom slippers. These are a tad less common but in some bathrooms you'll have to leave your slippers either right inside or right outside and put on a special pair of bathroom slippers.
Now that works ok if you're visiting someone's house, eating in a traditional Japanese restaurant, or visiting a shrine but it'd be a pain to wear those slippers all the time at a school or some other place that you spend a lot of time. There's where indoor shoes come in. There's nothing special about them, they're just a pair of shoes designated for indoor wear. For example, when I go to work in Japan I wear my sneakers on the way there. When I get inside, I take off the sneakers and put them in my shoe locker where I keep my other pair of shoes which I wear exclusively indoors. If I want to go back outside, I need to swap shoes again. Naturally, shoes that are easy to slip in and out of are a big plus.
I suppose all this shoe swapping helps keep floors a bit cleaner and reduces wear and tear on things like tatami and carpet, though there’s probably something a bit deeper to it as well. Anyway, while Japanese people are usually fairly tolerant of foreigners making breaches of etiquette (easy to do if you haven’t spent time researching Japanese manners), wearing your shoes where you’re not supposed to is still a big taboo so try to be careful and take your cue from the people around you.