I have lost my passport here in Beograd. Can I travel just with my Czech ID card from Belgrade to Budapest?
Yes, you can travel just with Czech ID card as Hungary is in European union and Czech republic has agreement with Serbia. Source: http://www.mzv.cz/jnp/cz/cestujeme/aktualni_doporuceni_a_varovani/srbsko_cestovani_na_obcansky_prukaz.mobi
EU citizens can enter and exit Serbia on a national ID Card, as stated by the Serbian MFA
So if your foreigner registration is in order, you'll be fine.
Hungary is in the EU, so you have freedom of movement there and can enter with an ID card
We have two yes answers both of them with wrong reasoning, providing the wrong links: the OP is already in Serbia, the kind of documentation necessary to enter Serbia is irrelevant. ytg's comment is the winner: as Hungary and Czechia is part of the Schengen Treaty and the European union, you can use your national ID card to enter and travel within the Schengen area. Travel documents for EU nationals:
You need this paragraph to enter the Schengen zone at the Serbian-Hungarian border:
When travelling to or from a non-Schengen country you must show a valid ID or passport.
And this one to go from Hungary to Czechia (possibly crossing SLovakia, another Schengen treaty member):
If you are an EU national , you do not need to show your national ID card or passport when you are travelling from one border-free Schengen EU country to another.