Hi Sarah & John - looks like you're going to be busy!!
When I first came out I rented for 2 weeks and then had to extend it by about a week or so until the car I bought was ready- a Seat Leon, wonderful car! The rental company said that they could do cheaper rates by going in to talk to them about extending the rental, rather than doing it online or on the phone, so if you need to do that you should go and talk to them. Also you should choose the rental company with the location of their office in mind, in case you have to go back and forward to sign papers.
As for buying, I decided to buy new as the price for one year old wasn't much different - ie hugely expensive! Cars are very expensive here so be prepared for a shock. I did my initial homework online but the garages then added so many charges it ended up much dearer than the prices quoted online. They do demonstrators (Kilometro zero) but I couldn't find one for the model I wanted.
There are lots of second-hand cars around from small garages (I assume it will be the same in your area) but some of them are pretty dodgy. If you can get personal recommendations then that would be a good start, and you may get some members here to advise on who to avoid and who you can trust.
I can't remember if you need to have your Residencia certificate to buy or not, but you will need an NIE number so you should apply for this as soon as you arrive, rather than leaving it until later.
Hope that is helpful and best of luck with the move.