The basic principles of economics are growth, peak, contract, trough. For investments as large as housing I'd prefer to be purchasing in the contract/trough area as opposed to the growth peak area. However, over the long run it should still slope upwards (unless California has some natural disasters or something to change our trajectory).
Our California housing market of recent is steep gains and sharp drop offs. For me, moreso than usual, I'd really be wary about purchasing now because it is an all out perfect storm right now (so prices should be high/increasing). If you are going to buy and sell in the next 3 to 4 years you should be okay (in my opinion). However, to me, if you want to maximize profit I'd wait until prices and # of houses sold start to take a dip and you could squeeze a lot of extra profit out. In the long run prices should (unless California breaks in half from earthquakes) should increase, but my main interest is in maximizing my return.
Just based on a gut feeling and having a pulse on the reality of work in the Bay Area it makes me feel that eventually interest rates will raise and people will not want to spend as crazy amount of money on houses. The market is being pumped high right now because of all the tech wealth. How long will it last is just a guess - but my guess is that in 6 to 8 years there will be a big drop (for a small period of time (3 to 4 years) and that is when I'd want to buy. It could be a mix of interest rates rising, tech people wanting to move to So. Cal. Texas, etc.
Also, it is the nature of economics that "something" will happen. We can't continue trending upwards. There will another recession at some point and that will drives housing prices down. Any bubble being burst will have that effect. As we are all connected globally the recessions should theoretically be less volatile, but should still occur regardless.
Small edit: I'd look into places that are being "gentrified" like Oakland as the best investment value if I were to buy today. Gentrified areas = better schools = always high house prices.
As the graph shows (SF), there was only about 100k increase if you look at 1987 vs. 2012. In my opinion, there HAS to be a down cycle and if you can save 100k+ on buying it makes sense to wait until it cycles downward.
Lastly, I always have a different mentality about real estate than other investments. The amount of effort involved makes me want a much higher rate of return potential (unless it is for a place for my family to live and not viewed as an investment). Stability for a family >>> money in that regard.