Yes, all PlayStation gaming systems share the same online network and user account system. There are some limitations, such as not being able to communicate with PS4 players from the PS3. If this doesn’t bother you then you are all good.
Anyone who had a PS3 and created an account for PSN on this system, can use the same username and password to log into PSN on the PS4 without needing to do anything. It will all work seamlessly. You can also log into the Vita and into the PS store on PC and mobile using the same PSN account. Unlike Nintendo, they did things properly…although that could be argued.