Osaka is the city the rest of Japan likes to tease. Tokyo is the capital and Kyoto is the old court, but Osaka was the merchants' city, the place where rice from every province was bought and sold, and it still behaves like one: loud, funny, practical and obsessed with what's for lunch. A local proverb says people in Kyoto ruin themselves on clothes and people in Osaka ruin themselves on food, which is where kuidaore, "eat until you drop", comes from. The city was briefly Japan's capital in the 600s and 700s under the name Naniwa, which survives in district names like Namba, and in 1583 Hideyoshi began his castle here.
It isn't a pretty city. The castle is a 1931 concrete reconstruction, the skyline is mostly expressways and office towers, and the neon on Dotonbori is more carnival than culture. That's the point. Osaka rewards people who eat standing up at a market stall, ride an old tram to a shrine and talk to whoever is next to them at the counter. Five days is the right length: three for the city itself, one for a day trip to Himeji Castle and Kobe, and one for Universal Studios Japan, which is a real reason people fly here.
The plan runs by district. Day one is Minami, the southern center, with Kuromon Market, Dotonbori and the lantern alleys. Day two covers the castle, Nakanoshima and the skyscrapers of Umeda. Day three is the old south: Sumiyoshi, Shitennoji, Tsutenkaku and Shinsekai. Day four is the day trip to Himeji and Kobe, and day five is the theme park. Start on a Friday if you can: Kuromon is calmer on a weekday, day two falls on a Saturday when the history museum is open, and the theme park lands on a Tuesday. On another start, keep day two off a Tuesday and Universal off a weekend. There's more on the country on the Japan page. Kyoto and Nara are an easy hop from here, and the Kyoto guide covers both.