A:
Yes, this is a "G" type lens. It will auto focus with any recent Nikon digital camera, like your D5000.
I used it on my D5600. But be advised, this will perform like a short telephoto on DX cameras like your D5000. It will be good for portraits--not good for trying to take a picture of a group of people inside a room. It's not wide enough. It will have a smaller field of view than a 50mm lens on a full-frame camera. But it's still a good choice for D5000. Nikon doesn't offer a DX prime lens this fast as a DX lens.