The solution to your problem could be user error, a calibration issue, or like you said a part failure. If I were you, I would first try approaching the object you are photographing from a different angle or position. There might be too much going on in the background for the autofocus to find something to zone in on. If this doesn't work, you should then try calibrating your camera lens. Nikon calls this process "AF Fine tune" and you can purchase a tuning kit or do a DIY calibration.
If that doesn't work, you may have to replace the focus motor. Refer to the troubleshooting page for the steps to replace this part.
WARNING: Replacing components on this camera is not an easy task and it requires a good amount of time and patience to do it correctly. There are many components and wire connections through out that will need to be re-soldered if you are not careful. Make sure you remove the battery and that the flash capacitor is discharged as it will hold charge even after the battery is removed and you will get shocked. If you do not have experience working with electrical components then you may be better off sending the camera to Nikon's service department to be repaired. It will cost a pretty penny, but you won't get shocked and your camera will not be damaged.