Most hotels and apartments will ask you to sign a form similar to this one when you check in. Italian law requires your details to be reported to the local police. There are two places to sign on the document, one confirms the details and the other allows the information to be reported due to privacy laws.
Some hotels/b&Bs are now submitting this form electronically but even then you may be asked to sign their copy.
(I've blocked out my signature and passport number on the scan)