You can show this concerning the optimization problem with the objective function $U_0 = f(x_1) + x_2$ and the budget restriction $M - p_1 x_1 - p_2 x_2 = 0$. Using the Lagrangian, this leads you to
$$
f'(x_1) = \frac{p_1}{p_2} \quad \text{or} \quad f'^{-1}(\frac{p_1}{p_2}) = x_1^{*} = D_1(p)
$$
You can see that in this special case the optimum quantity of $x_1^{*}$ (Marshallian demand function) does not depend on the income $M$
$$
\frac{\partial D_1}{\partial M} = 0,
$$
The income effect is therefore zero, and you will not consume a different amount of $x_1^{*}$ if the income $M$ varies.
Some further considerations: Based on the Marshallian $D_i(p, M) = x_i^{*}$ and Hicksian $H_i(p, u) = x_i^{*}$ demand function, you can show some interesting properties of this particular utility function using the Slutsky equation:
$$
\frac{\partial D_i}{\partial p_i} = \frac{\partial H_i}{\partial p_i} - x_i^{*} \frac{\partial D_i}{\partial M}
$$
This shows that the derivative of the Marshallian demand function with respect to price equals the derivative of the Hicksian demand function with respect to price minus the optimal $x_i^{*}$ times the derivative of the Marshallian demand function with respect to income. In this special case, the Marshallian demand function equals the Hicksian demand function, as $\frac{\partial D_i}{\partial M} = 0$.