The general solution of $y'=\vert y-t\vert$ 
How to solve the following ODE? $$y' = | y-t |$$

To eliminate the absolute value, I divided the domain into two parts $\{ y(t) > t \}$ and $\{ y(t) < t \}$.


*

*In $\{y(t)>t\}$, the ODE becomes $y'=y-t$. I found $y_+(t)=Ce^t+t+1$. 

*In $\{y(t)<t\}$, the ODE becomes $y'=-y+t$, so the solution is $y_-(t)=Ce^{-t}+t-1$.
How to write the general solution?

The two solutions are indeed separated by the main bissector $y=t$, and are curves asymptotic to the straight lines $y=t\pm1$.
For $C\ge0$ and $y_0\ge1$, $y_+(t)$ is wholly contained above the bissector and is the solution everywhere.
For $C\le0$ and $y_0\le-1$, $y_-(t)$ is wholly contained below the bissector and is the solution everywhere.
For $-1<y_0<1$, the solution is made of two pieces, such that $C_+<0$ and $C_->0$, which meet on the bissector, where they must have equal slopes.
$$\begin{cases}C_+e^t+t+1&=C_-e^{-t}+t-1=t,\\C_+e^t+1&=-C_-e^{-t}+1.\end{cases}$$
The solution is
$$C_+=-e^{-t},C_-=e^{t}$$ for some $t$.
For $y_0\ge0$, $t=-\log(1-y_0)$, and for $y_0\le0$, $t=\log(1+y_0)$. 

