You should deactivate your PS4 so it's no longer associated with your account if you are selling or giving it away.
PS4 controllers will work with a PS3 console, and when you use a wired connection, there is no setup involved. Here's what ...