The CPF, Cadastro de Pessoas Físicas, is an eleven-digit tax number, and in practice it is Brasil's master key. You'll be asked for it at the pharmacy, when buying a SIM card, signing a lease, opening a bank account, enrolling a child in school, and sometimes when buying groceries online. Not having one doesn't make these things impossible; it makes each of them slower, and some of them absurd.
Foreigners can obtain a CPF before arrival, and on every BFY route we do it as part of the file, it's one of the first artifacts sealed in your case. If you're doing it alone, there are three ways:
A CPF gives you no immigration status whatsoever. It's a tax identifier, tourists can have one. Don't confuse it with the CRNM (your residence card), and don't let anyone sell it to you as a "first step to residency" as if it carried legal weight. It carries convenience, not status.
There is no physical CPF card anymore, the number is the document. Memorize it; Brazilians recite theirs like a phone number. And treat it like one: leaks happen, and a CPF plus a birthdate is enough to open credit lines in some stores. Give it when asked by institutions; decline when the corner shop wants it "for the system".
On a BFY route, the CPF, the apostilles, and the permit ride in one dated file.