If you do something like this, you definitely want it in writing. However, I'm going to suggest not doing it. If things don't work out as planned, for whatever reason, it can wreck your friendship.
For what things in life do you even need a car, is there a car sharing service like Zip that can meet those needs? Is public transit simply not an option, or merely an unpleasant option?
Honestly, I'd do the best you can to be entirely car free if possible. If not, since you can't afford $5k, I'd get a beater for what you can afford.
Lastly, while I don't know your car market, I'd take a long look at craigslist, kijiji, used<city>. $5k for a ten year old Matrix with 108k miles would not be a good deal around here.