  This paper investigates the consumption and investment decisions of an
individual facing uncertain lifespan and stochastic labor income within a
Black-Scholes market framework. A key aspect of our study involves the agent's
option to choose when to acquire life insurance for bequest purposes. We
examine two scenarios: one with a fixed bequest amount and another with a
controlled bequest amount. Applying duality theory and addressing free-boundary
problems, we analytically solve both cases, and provide explicit expressions
for value functions and optimal strategies in both cases. In the first
scenario, where the bequest amount is fixed, distinct outcomes emerge based on
different levels of risk aversion parameter $\gamma$: (i) the optimal time for
life insurance purchase occurs when the agent's wealth surpasses a critical
threshold if $\gamma \in (0,1)$, or (ii) life insurance should be acquired
immediately if $\gamma>1$. In contrast, in the second scenario with a
controlled bequest amount, regardless of $\gamma$ values, immediate life
insurance purchase proves to be optimal.
