Question:
The opportunity cost of an investment is the real interest rate, and that's why investment demand depends on the the real interest rate. The effect of inflation "cancels out" because, although it increases the cost of borrowing funds, it also increases the value of the capital goods in which the funds were invested, which grow at the rate of inflation.