I want to show that the following expression is a local martingale: $M_t=V(X_{t\wedge T})+\int_0^{t\wedge T}f(X_s)ds,$ where $T$ is some stopping time (there are more conditions, but they are not important for my question).
Where $X$ is some process, and V is sufficiently nice for Ito to be applied. My problem is how to get around the problem, that the integral on the right ranges from $0$ to $t\wedge T$. My first inkling was to apply Ito to $X_{t\wedge T}$ first, but it does not seem to be working.