Can you go to a city and book a room in a hostel for that same day?
It's not easy special in the summer. The best option is to book but in some youth hostels they ask for a percentage of the total amount. I recommend you to book when you are sure you go to that place!
Where can you find, when you're in a city, where the hostels are?
That is part of your homework... or you can go to a tourism office or a netcaffé and search
Are there youth hostels under 20 euro?
Yes there are but it depends for where you are going to travel... For example: in Spain the most expensive youth hostel I experienced, I paid 18 €!
And how do you find campings?
Usually each country as its own federation camping website with informations about places where you can find them and prices, etc...
Is breakfast included when you stay in a hostel?
In the majority