When inflation rises, consumer prices increase. This leads to a decrease in consumer spending, as people are not willing to pay more for the same goods and services. 

This reduced consumer spending then leads to a reduction in overall economic activity, which in turn reduces GDP. 

The opposite is also true: when inflation falls, consumer prices decrease. This leads to an increase in consumer spending, which stimulates economic activity and increases GDP. 

Inflation also affects GDP in a more indirect way. As prices rise, businesses tend to raise the prices of their products in order to cover the increased cost of production.

This leads to higher prices for consumers, which in turn reduces consumer spending. This reduced consumer spending once again leads to a reduction in GDP. Inflation also affects the value of the currency. 

As prices rise, the purchasing power of a currency decreases. This can lead to a decrease in foreign investment, as foreign investors are less likely to invest in a country with a weaker currency.  

This decrease in foreign investment can lead to a decrease in GDP. Inflation can also lead to higher interest rates. As inflation rises, central banks tend to increase interest rates in order to curb inflation.

This increased cost of borrowing can lead to decreased investment, as businesses are less likely to invest in a country with higher interest rates. This reduced investment can lead to a decrease in GDP.