Public transport in Croatia covers regular connections between the cities. Most common types of public transportation are buses and trains. You can use them for domestic travels or international ones. Both offer discounts for students, seniors, unemployed etc.
You can find all information about train connections (timetables, map of rail network) in Croatia here: https://prodaja.hzpp.hr/en . You can buy train tickets at the train station. If the train office is not open (mainly small towns and stations), you can buy tickets at the train, but be aware of the higher price if you want to buy the ticket on the train and the ticket office is open. International connections are also available.
There are regular bus connections between towns and cities across the country, as well as international connections. See http://www.akz.hr/en for more info.
Public transport in cities
Every city has its own public transport where buses and/or trams drive regularly and frequently. In Zagreb, you can buy a prepaid card (Croatian: pretplatna karta), a stored-value card (Croatian: vrijednosna karta) or a paper ticket for each trip. You can buy paper tickets and load the credit on your cards at any Tisak kiosk. You can also buy paper tickets in buses and trams from the driver, but in that case you will pay more than buying the same in Tisak.
More about tickets is available here: http://www.zet.hr/tickets-and-fares/601
For Osijek, see more here: http://m.gpp-osijek.com/web/index.html