Q:

Is it smart to only invest in mid- and small-cap stock equity funds in my 401(k)?

Historically, mid-cap and small-cap company stocks have outperformed the market. Correct?
Since I'm not going to touch the money in my 401(k) in over 40 years, wouldn't it make sense to invest exclusively in these types of funds now, and only worry about moving into safer investments decades down the road?

A:

If the stock market dropped 30%-40% next month, providing you with a rare opportunity to buy stocks at a deep discount, wouldn't you want to have some of your assets in investments other than stocks?
If you don't otherwise have piles of new cash to throw into the market when it significantly tanks, then having some of your portfolio invested elsewhere will enable you to back up the proverbial truck and load up on more stocks while they are on sale.
I'm not advocating active market timing. Rather, the way that long-term investors capitalize on such opportunities is by choosing a portfolio asset allocation that includes some percentage of safer assets (e.g. cash, short term bonds, etc.), permitting the investor to rebalance the portfolio periodically back to target allocations (e.g. 80% stocks, 20% bonds.)
When rebalancing would have you buy stocks, it's usually because they are on sale. Similarly, when rebalancing would have you sell stocks, it's usually because they are overpriced.
So, don't consider "safer investments" strictly as a way to reduce your risk. Rather, they can give you the means to take advantage of market drops, rather than just riding it out when you are already 100% invested in stocks.
I could say a lot more about diversification and risk reduction, but there are plenty of other great questions on the site that you can look through instead.

