You can invest in both the stock market and in real estate -- and many people do. Someone could buy a house to live in while placing money in a 401(k) retirement plan that invests in the stock market. That person will eventually have investment income from both sources. This is known as hedging your investments.