To use your PS4 controller on a PS5, connect it to the PS5 with a USB cable and press the PlayStation button on the controller.
You can choose to appear offline on a PS4 when you first log in, or at any time when you're online. Here's how to do it.