I'd say in your case, no.. Do not do that. Mainly because this is FRIEND, not a long term girl friend/wife. No matter how you cut that situation, it's not really an idea that I would suggest diving into.
Now on my hand, I bought a small 2 bed 1 bath house 1 week after I turned 23. It worked for me because I could afford the house completely on my own, and it actually cost my less in the short term, than renting. I knew it would just be a short buy (hold for 5-7 years) then I would sell it and hopefully just break even. I am now 25 and happy with my choice. Only a few things have needed fixing along the way so I think I got lucky.
I suggest you just keep renting and wait for the house buy. Only way I would suggest you buy is if you find a place you could afford completely by yourself, and then rent a room(s) out for extra income. That's what I do and it's worked great.