Are you asking for Florence?
While there are no hard rules. If you are paying 10 euro or less, many caffes and small shops will not accept card payment, as comisions make it unprofitable.
I would recomend having some cash on you for emergencies.
Both Leonardo and Casadiamici are correct for the parts they answered.
My suggestion is to always carry some cash with you for small purchases like gelato, coffee, snacks and so forth (like for anything under 20 euros), and then use credit cards for the rest, including restaurants.
Even if Casadiamici is correct in saying it is very common, it also isn't the only reason why places ask for cash -- as Leonardo implied, there are high fees from Visa and Mastercard to them as operators for each transaction they request from the circuit. So if they are SMALL, FAMILY-BASED B&Bs (I am talking small), it is likely they have decided they cannot afford those fees --- and for that reason, don't take credit cards and ask for cash. Let's not assume they are tax-evading as their reason for this request.
I would suggest you contact any place you are interested in and ask whether they accept other forms of payment, that you don't feel safe carrying around cash on your travels. You shouldn't have to!
Then it is up to you: choose somewhere else to stay at if they won't work out a way to pay them or, if you really want to stay there, figure out together a way to pay them. This could be a payment on arrival (a visit to the ATM) and another at departure (another visit to the local ATM if you have to). That way you are not carrying around too much cash on you.