what gun should i buy for under 1000 dollars?
Well, now, THERE'S an open ended question if I ever read one!
It might be a great idea to give us a bit more info on what your likes and dislikes are. But, if I may, I'll take a different tack.
Most people who ask this kind of question are thinking ONLY about the gun. Then they're either surprised, or upset, to find that there are other expenses to gun ownership that they didn't think about or consider.
For instance, a good holster and a good gun belt to support that holster. Depending on what you settle on, these two items can run you $200, more or less depending on what you find that meets your needs and that you like.
That leaves you with about $800 for the gun.
Then there's the ammunition you need to feed your gun. Depending on what you get, that can run you a pretty penny, too. Buying in bulk, for example, a thousand rounds of 9mm ammunition can run you anywhere from about $150 for steel cased FMJ to $500. Winchester White Box runs about $20 for a hundred rounds at Walmart. And that's not counting anything you might settle on for personal protection ammunition.
Any gun you buy, you'd be smart to buy a box of several different brands and types to see what cycles reliably and how it affects your point of aim.
As my wife once said: "That didn't take long to go through a hundred rounds."
So figure $100 for initial ammunition cost for a few boxes. That leaves you with about $700 for the gun.
There are other miscellaneous things you might want along the way, too, depending on your wants, tastes, and needs. Maybe you want to get a trigger lock. Maybe you want to buy some targets. Maybe you have range costs, because you don't have anyplace to shoot for free. Maybe you want a "safe" of some sort. Maybe you want a carry bag. Maybe you want extra magazines.
SO...my advice is NOT to spend the full $1,000 budget on the gun itself, unless you already have money budgeted away to take care of some of these other things.