You might want to get an idea (a quote) before you go to get it repaired. The repair might not be worth it compared to updating to a newer DSLR (ex. if it were $150 to repair it, I'm not sure if you'd rather spend $500... depends on what you want).
The ghost-like thing is probably the sensor. You should look up some guides on how to clean your sensor. I'm not sure if the D5000 comes with built-in sensor cleaning (you have to do manual cleaning as well but there's built in features in my D5200 for example, not sure how it helps). I would try doing that first anyway... built-in features, and also physically clean the sensor by following guides & getting info from someone who knows how to do that.
The lens issue could be the lens itself, or with the camera. If there's enough dust on the sensor (and I could be wrong), I'm thinking it might be possible that's interfering with your autofocus capabilities. You might be getting soft images from inaccurate focusing.
As with any technology, I go step-by-step. I rule out particular things first. Start with the sensor, then move to anything else that you can do yourself, try to determine if you have multiple issues or one (ex. if the lens has an issue at all or if it's just the camera), and just keep going from each point. That way you don't end up spending an arm and a leg when you don't necessarily need to.