Buying lenses for Nikon D5000?

I'm writing just to ask a quick question about lenses for my Nikon D5000. I have now come to a point where I would like to learn how to shoot with a tele lens. So far I have a prime lens and the lens which came with the camera (18-105mm).
I would like to get a tele lens to around 300mm.
As I assume, it will be quite expensive I would like to know if, once I change my current camera to another one (still Nikon), I can still keep the lens.
So far I haven't planned to change my camera, but in the future it is very likely I will go for a better one, maybe a 'Full Frame'. I just want to know in advance whether I'm going to 'lose' the lens in an eventual change of camera or if there's a way to still use the lens.

If you buy Nikon DX lenses, then they will fit (& work) on any future crop body Nikon you may buy.
They will ALSO fit & work on a full frame body, but the FX camera body will automatically recognise that a DX lens is mounted & only use the centre portion of the lens - this means that the MP of the image will be smaller than the native MP of the camera body.
If you buy FX lenses, they will fit (& work) on either DX or FX bodies.
Good review of the 300mm f4 lens here (comparison of the new AF-S version, which will autofocus on your D5000, with the older, non AF-S version, which wouldn't).
http://www.bythom.com/300afslens.htm

The Nikon AF-S VR Zoom-Nikkor ED 70-300mm f/4.5-5.6G is supposedly a good performer.
Everything deep blue2 said is perfect but I don't agree with his lens recommendation. If it's your first telephoto lens I'd be more pushed towards you getting a zoom lens. Like the 70-300 or a 70-200mm F/2.8 from Sigma if you need a wider aperture for shooting in low light.
I've shot sports professionally for quite a while and I use a Canon 400mm F/2.8 and as a prime telephoto lens it's uses are pretty limited, I've only ever used it for sports. However, something like a 70-200 would be much more versatile - I use mine for sports, weddings, gigs, portraits etc. The 70-300 would be a similar performer but it wouldn't be as fast to focus as the 70-200 which is widely regarded as a lens which must be in every photographer's kit (much like the 50mm F/1.8).

I bought the 70-300mm f/4.5-5.6 for my Nikon D5000 for the off-chance I might get an FX or film body.
I probably won't upgrade to FX now, but at the time it was the only reasonably priced AF-S lens that went to 300mm, and it is much better performing than the cheaper 55-300mm DX lens that came out later (faster autofocus, better VR, better optics since you are only using the best part of the lens for DX).
It is a heavy and bulky lens for the D5000, so it only comes out for airshows, wildlife, and the odd portrait. The rest of the time I either have my 18-55mm or my 35mm 1.8 on.

Sigma 70-300mm f/4-5.6 SLD DG Macro Lens is better.