As @philipkendall says, it may be a camera body issue. If some images are ok, while others are not, it suggests the lens (which is unchanged across pictures) is ok.
It may be that either one or both of the white balance and exposure compensation settings might have been knocked.
White Balance
If this is set incorrectly this may explain why some of the photos look blue. On the back of the D50, hold the WB button and rotate the command dial and ensure the setting is on Auto. If this is set to daylight or flash by mistake, for example, this would account for the blue tones.
Exposure Compensation
Next, the images might be too dark if the exposure compensation is too low. To check this, there's an exposure compensation button on the top of the D50 next to the shutter release. It looks like a plus/minus sign, like this: http://djshawphotography.com/wp-content/uploads/2013/03/5_1.jpg
Hold this, and rotate the command dial to make sure this is set to 0.
If these don't work
If you can, check the lens on another Nikon body. It will work on any digital Nikon. This will confirm if it's the lens or body that's at fault.
If it's the body, given the age of the D50 you may want to consider simply buying a new, or more recent second-hand, body.