After applying at the office of Policia Federal, which is obligatory if you are staying in Brazil longer than 90 days, you have to apply for a tax card (called Cadastro de pessoa f'ísica – CPF or formerly also known as Cartão de Identificação do Contribuinte – CIC) at the local tax office.
To apply for the tax card you have to bring your passport and the receipt which you obtain when applying for your Foreigner's ID (RNE) at the Federal Police. After 2 or 3 weeks your CPF card should be ready for collection. The CPF contains the name of the taxpayer and the tax number. This number is extremely important as you will need it for essential matters like renting an apartment, opening a bank account or registering a car.