You need to do these things to use the train in Japan with your bike
Rinko Bag
One can bring their bike on any train in Japan but the requirement is that it be put inside a bag (known as a rinkobukuro, 輪行袋). These backs largely have two types, those where both wheels need to be taken off and ones where only the front wheel needs to come off. For speed (and protecting the rear derailleur we tend to prefer the latter).
Generally speaking, having the seat poking out is acceptable however, JR Shikoku is known for being a stickler and insisting that the entire bike being covered and having to take the seatpost out and carrying it separately.

Check out Road Bike Rental Japan’s overview Video – https://www.youtube.com/watch?v=ebahQhLMi0o
Bike Box

Most people who bring their bike from abroad arrive at the airport with their bicycle in a box. Taking your bike on the train while still in the box is fine but most rail operators have a rule that the maximum size of luggage that can be brought into the train of the sum of all dimensions being 250cm (the author has had the Haneda Airport Keikyu staff measure their bicycle box)
Ettiquette
Trains are crowded in cities, try your best to avoid the crowds if at all possible. Try to travel before or after the morning rush hour (if travelling on a weekday). Also, the front and last cars of trains tend to be a bit less crowded.
“Cycle Trains”
There are some trains that are specifically designed for bicycles to be taken on as is.
B.B.Base
From Ryogoku Station (Eastern Tokyo) to various places in Chiba Chiba. Bicycles
JR’s B.B.Base website (English)
Other Trains
Some train operators allow users to take bicycles as is onto all or some portions of their network at some times.
However, these are generally not in urban areas but on local operators and change relatively frequently. The below website does a good job of bringing that information together (in Japanese)