Where to invest in times of inflation?

First, let's demystify the jargon. Inflation is a situation where there is 'too much money chasing too few goods'. In such times buyers bid up prices of scarce products/services. The scarcity could be caused by supply issues or a faster than expected rise in demand. Irrespective of what causes inflation, the impact is the same. The value of the currency you are holding declines.

Let's explain this with the help of an example. Suppose the Indian Rupee was freely exchangeable with only one commodity - crude oil. Let's assume the conversion rate is Re 1 = 1 barrel of crude (wish it were true!). Now there is tension in the Gulf region resulting in reduced supply. Due to the subsequent rise in price of crude oil in international markets, we would now have to pay more Rupees for every barrel of oil. Suppose crude prices rise by 10%. The new exchange rate will be Rs 1.1 = 1 barrel of crude. In real terms (i.e. in terms of the commodity) the value of the Rupee would have declined from 1 barrel of crude per Rupee to only 0.91 barrel of crude per Rupee. This is the erosion in the value of the currency that we are talking about. Also note that while the Indian Rupee may be appreciating vis-a-vis other currencies, in the 'real sense' there is an erosion in value.
Another important fallout one can expect due to rising inflation is higher interest rates. The central banks aim to reduce demand in the economy by raising the cost of money.
We are not going to debate whether or not interest rates will rise or the Indian Rupee will depreciate going forward. This we will leave to the experts. If you wish to have a go, click here for the What if Yield Calc. We will focus on what to do in times of inflation.
When making fresh investments or evaluating your existing holdings in potentially inflationary times you need to keep two things in mind:

The possibility of higher interest rates
The erosion in the value of the currency

What you should avoid?
Fixed income instruments life fixed deposits and relief bonds that have long maturities
Other long term debt instruments like long term debt funds
Shares of companies that are unable to pass on the rise in raw material costs to their consumers i.e. they are not price setters.

Where should you invest?

1. Commodities

The key factors that determine the price of a commodity like gold for example (mine output for one) are different from factors that impact the value of other investments like shares and bonds. Investing in commodities therefore helps in diversifying the risk element in your portfolio. Not to suggest that they will surely do well but in inflationary times, but people do increase their allocations towards commodities. (Read more on gold)
Furthermore, gold can now be deposited with institutions like the State Bank of India. While this will earn you a very marginal interest, it will nevertheless take care of storage costs etc.
Investing in a commodity takes care of the risk arising due to erosion in value of the currency (since most currencies are priced in US Dollars).

2. Stocks
When it comes to beating inflation, few asset classes can better stocks. For example, over the last three years stocks have returned in excess of 15% p.a. (the BSE Sensex), beating inflation, which averaged about 5% - 6% p.a., by a very large margin. If one were to use a diversified mutual fund as a benchmark for stocks, the difference would have been even larger!
However, stocks carry significant risk, especially if one is attempting to build his/her own portfolio of stocks. For those who wish to minimise this risk, equity mutual funds are the best option.
For the more adventurous type, two sectors that are relatively immune to inflation are pharmaceuticals and software.

3. Inflation indexed bonds
Such bonds compensate you for the rise in inflation (or the decline in the purchasing power of the currency). Unfortunately in India such bonds are not on offer for us individuals (though the RBI has spoken about reintroducing them in today's policy). But with the RBI permitting Indians to invest abroad, one can always buy them in international markets.

4. Short term deposits and funds
These instruments will give you the required liquidity you need while ensuring that you do not lose out in case interest rates were to rise.

5. Property
Property is again a preferred avenue of investment as in such times prices tend to rise upwards in line with the increase in cost of construction. The only deterrent here is that the minimum amount you need to invest here is substantial and beyond the reach of most investors. An alternative can be real estate mutual funds, which are very popular in international markets. Apparently, SEBI is considering allowing such funds in India.

To conclude, it is important that at all times investors should ensure that their portfolios are well diversified, taking into account their needs and aspirations.