How did investment go from exogenous to endogenous in the IS/LM model? Context: I am currently taking an introductory course to macroeconomics and we are on the topic of Keynesian Economic and the IS/LM model.
Initially we saw that the investment (I) component of aggergate/planned expenditure is considered autonomous expenditure, which I understand to mean it is not dependant on income.
Additionally when we were covering Withdrawals and Injections to the circular flow modelt. Here the textbook said investment(I) is a withdrawal from the circular flow model and withdawrals are exogenous. Exogenous was defined as not directly related to changes on income.
However when introducing the IS/LM model, a video tutorial said we are now going to make investment(I) endogenous to derive it IS curve by defining it as a function of income(Y) and interest rate(i).
My question is how did we get from investment (I) as exogenous investment (I) as to endogenous?I understand we used interest rate(i) to link our financial market with our goods market which makes sense but how does income factor into that after we have already said that investment (I) is autonomous spending/exogenous?
It seems there is something im missing here!
In the earlier model the fixed investment was a simplifying assumption made for didactic reasons (you dont want to overwhelm students), rather than because investment is actually fixed in general. In fact, it is not exogenous even in a full circular flow model (what you probably seen were simplified versions), but in a full circular flow model investment is actually dependent on income (investment is given by savings and savings are just unconsumed income) and endogenous as you can see below in a picture taken from Krugman Economics:

What you refer as the previous model was likely the basic goods market equilibrium for closed economy as in Blanchard et al Macroeconomics:
$$Y = C+I+G; \text{ with } C=b_0+b_1(Y-T)$$
The reason why investment in the above model is considered to be fixed/autonomous is not so much because it would actually be fixed, but because fixing it allows to make the model more simpler. However, this really models only small portion of the full economy as you can see from the picture above.  There are actually non-IS-LM extensions of the basic model where $I$ won't be fixed and you just assume there is some additional function $I(Y)= a_0 + a_1Y$ and you could solve the model for the multiplier and everything else.
However, most courses will just first cover goods market equilibrium and afterwards move onto IS-LM model due to lack of time.  IS-LM model will try to capture economy in its entirety so it will model the link between income and investment through savings in explicit fashion.
You will still have the goods market given by
$$Y = C(Y-T)+I(Y,i)+G$$
but now $I(Y,i)$ will depend on income and interest rate, which in turn also depend on equilibrium in the money (financial) markets described by LM equation ($M/P=L(i,Y)$). This really represents adding the arrow of private saving, borrowing and investments spending from the picture below into the model.
In summary, the main reason why it went from exogenous to endogenous is that in a sense that generally speaking it never was exogenous (a caveat is that more complex models can show that there are periods were it can be - but not generally and that whole another topic that is well beyond scope of this answer). The previous assumption was there so you can be first exposed to goods market equilibrium and multiplier idea without worrying about what happens to investment.