Staying online in Japan is actually simple, though costs will rise the more convenient you want it to be.
Your main alternatives are: Your hotel Wifi connection (some still use wired), Free Wifi hotspots, SIM data cards, Pocket Wifi and International mobile plans from your local provider.
If you want to get and make conventional phone-calls with your normal number, you will have to go with the international mobile plan from your provider, which is usually the most expensive, though some carriers do have promotions and some even have temporary/limited free plans. Check with them before planning any other.
Then, you can have only data connection (which will prevent only normal phone calls, but all data based system will work, including VOIP, like Facetime, Skype, Google Talk, Whatsapp and so on) by buying either a SIM data card or renting a Pocket Wifi.
SIM cards are basically a normal mobile SIM card that have only data connection. You switch your SIM card (your phone must be unlocked - carrier free) with the purchased SIM card and you will have internet for the duration of the card plan. This is a great solution for single person usage, and don't require any extra hardware and some you can just trash after using.
Pocket Wifi are small mobile routers that connect with the internet with their own mobile connection (3G or LTE) and share it using a short-range Wifi connection that one or more people can connect to (depending on the plan). A great usage for multiple person use. The caveat is that you need to carry the router around, and return at a valid drop-point after use.
Most big towns in Japan, specially in big malls or department stores, have "free wifi". These are usually bound to some kind of promotional system. One of such is a plan where foreigners register an account that is valid for 14 days using their passport and gain access to thousands of hotspots. There are also paid plans from the big companies that have even better coverage. The downsize is that it is still just wifi, and only in select places.
Most hotels nowadays have free Wifi on the room (some only on the lobby, and some old-school still use ethernet cables for internet access, check the Hotel for "Free Wifi on the Room" when booking). This will give you arguably unlimited connection while in your hotel room for free. If you can live without posting and sharing during the day and then do it at the hotel, this is the best alternative.
If you need connection on the go, then the best are probably a Pocket Wifi or a SIM data card. The first require reservation and rental at your choice airport, while the second can be bought even from some convenience stores. The following site have an in-depth comparison and links to the most used companies for both: