I would assume that, unless the government has proof otherwise, they have to take your life story on face value. They may take a long time investigating, but -
The key thing is to get something established. The welfare department or such may not choose to for example, give you the government’s money without you meeting their formalities. But someone, somewhere, especially someone who does not have to give you money, will probably at least begin the process to establish your identity. (If you are arrested, they’ll start the process much faster).
I doubt they can deport you, because they would have to prove you don’t belong and that your back story makes no sense. Of course, if you belong to an ethnic minority from outside the country and their language is your home language, things could get dicey.
However, you can usually point to someone and say “this is my father/mother”. DNA will establish the truth. You may not have documentation, but they will. And so on.
As has been discussed in several threads, your identity is a cumulative collection of a massive number of factoids and breadcrumbs your life leaves. As others point out - social security, a job, drivers’ license, bank account, education, previous addresses, neighbours, doctors and clergy - somewhere you made an impact on someone or something.
The scary thought is that someone like Jaycee Dugard’s kidnappers or the guy in Cleveland could be wandering around with a child or two well past the age to attend school and obviously nobody tweaked to anything like lacking in paper trail, no school attendance, etc.