A small (1300 sq ft) house in SF can be bought for $750K in some neighborhoods in the south of the city. The ones in between the fancy ones and the crappy ones.
I did a pretty detailed analysis of what everything would cost. Loss of investment income on the down payment, insurance, property taxes, etc. And came out to around $4100.
You can rent the same house in SF for around $3750/month, so unless you're assuming a pretty spectacular rise in home values, it doesn't make sense to purchase.