Solve $x'' = x + t$ with those initial conditions to get $x = \sinh(t)-t$: note that $x \ge 0$ for $t \ge 0$. Solve $x'' = -x + t$ with the same initial conditions to get $x = t - \sin(t)$: note $x \le 0$ for $t \le 0$.
So the solution is
$$ x(t) = \cases{\sinh(t)-t & for $t \ge 0$\cr t - \sin(t) & for $t \le 0$}$$
Related Questions in ORDINARY-DIFFERENTIAL-EQUATIONS
Solve $x'' = x + t$ with those initial conditions to get $x = \sinh(t)-t$: note that $x \ge 0$ for $t \ge 0$. Solve $x'' = -x + t$ with the same initial conditions to get $x = t - \sin(t)$: note $x \le 0$ for $t \le 0$. So the solution is $$ x(t) = \cases{\sinh(t)-t & for $t \ge 0$\cr t - \sin(t) & for $t \le 0$}$$