What sort of behavior could be considered rude or offensive in Japan?Everyone so far has mentioned some of the most important tips but I'll throw out a few more. Note -- this is a mixture of do's and don'ts.
- Bring back omiyage (usually edible snacks with some sort of link to a region -- whether it be a food popularly found there, or a common Japanese snack with a special regional flavor, or even just a normal Japanese snack with pictures of the place plastered on the box). This is especially important in the Japanese workplace, where your co-workers will expect it when they know you've been traveling. Note -- for close friends it's better to bring back something non-edible as well.
- Don't eat while in motion. This includes while walking or while riding on public transportation vehicles. The one major exception is the shinkansen where longer rides and more personalized seating make this socially acceptable. Also, the food cart selling snacks is a good indicator of its acceptability. Note -- this generally applies to drinking as well. Notice how vending machines are always surrounded by recycling/trash bins but you can never find them anywhere else? There's a reason for that. Either you finish your drink next to the vending machine and toss it or you carry the bottle all the way with you until you get home (or to a train station).
- Wear your yukata correctly. I'm talking specifically about yukata because I think most foreigners tend to wear them rather than actual kimono. Make sure you tie it on the wrong side -- if you mess this up, it is reminiscent of a funeral because dead people have theirs tied on the opposite side. Note -- for men, make sure you always keep your yukata in place, especially at the top. I can't tell you how uncomfortable it makes people to see a loose top which leads to an opening which leads to a peep of a hairy chest ... gross.
- Take special care at onsens/public baths. As User mentioned, shower before entering. Shower VERY thoroughly. Even if you showered that morning, it's important to show just how carefully you are scrubbing yourself. At the end, use the bucket provided to pour water over yourself. Keep your hair out of the bath -- either put it back with a hair tie or use your small towelette to secure it in place. Never let your towelette touch the water either. And, of course, do not swim in the onsen.
- Do not blow your nose in public. If you need to, take yourself away to a bathroom first.
- Don't touch people. Even if you're in a photo together, you should keep your hands to yourself. There's a reason why the peace V^_^ is so popular in Japan; try it out.
- Be careful of appearing braggy. In general, in Western contexts, it's considered not just acceptable but also a good thing if you compliment the people close to you to others. "My wife's cooking is amazing." "I have two beautiful daughters." These are considered strange in Japan, where you spend much of your time deprecating yourself and those closest to you in order to appear humble.
- Don't leave a tip. Most Japanese people will do their best job without expecting a tip and won't be pleased with your offer of a tip. This includes cab drivers. Note -- this does exclude some of the fancier Western hotels and restaurants, where tipping is becoming more common.
In general, people in Japan consider actions rude when they are a bother to anyone else. For Westerners this can sometimes be difficult in the beginning because actions which are seemingly innocuous to them can be considered quite offensive to others. Take care to observe the reactions of people around you and you will quickly learn what actions are not acceptable in public, even if they seem fine to you. Overall, they are very forgiving towards Westerners and will let you offensive actions even when if it would have been deemed completely unacceptable if committed by a Japanese person. Of course, this might be a symptom of some sort of social superiority complex, so you should try to not fulfill their expectations of Western rudeness in that regard ;)