And you plead the 5th after going under oath. And you can't just plead the 5th to any question. If the prosection puts you under oath and asks you your name, you can't plead the 5th to that
5th amendment protections can include questions of identity, if the question of identity is relevant for incrimination. Like, if the government has a warrant for "Joe Smith", you're not required to testify whether that's you. It's usually a waste of time since could just prove it with the non-testimonial evidence that lead to your arrest, but the protection does exist.