How to solve $y''(t)=|y(t)|$ Solve differential equation: $y''(t) = |y(t)|$
My attempt to solution:
I could not find all solutions possibles to the problem. And I do not know how to continue.
$1)$ We know that $y''(t) = |y(t)| \Rightarrow (y''(t))^2=(|y(t)|)^2 \Rightarrow (y''(t))^2=(y(t))^2$
$ \Rightarrow(y''(t) - y(t))(y''(t) + y(t))=0$
$2)$ Define:  $y_1''(t)=y_1(t)$ and $y_2''(t)=-y_2(t)$
$3)$ So, we have three possibilites,
First is: For all real $t$, $y_1(t)$ is solution of $y''(t) = |y(t)|$
Second is:  For all real $t$, $y_2(t)$ is solution  of $y''(t) = |y(t)|$
Third is: $y_1(t)$ is solution  of $y''(t) = |y(t)|$ for some values of $t$, and $y_2(t)$ is solutions  of $y''(t) = |y(t)|$ for the remaining values of t.
$4)$ I test the First situacion, and I find the condition for it:
The general solution of $y_1''(t)=y_1(t)$ is
$y_1(t) = C_1.e^{t}+C_2.e^{-t}$
So, if $y_1(t)$ is solution for all t, implies that $y_1''(t)=|y_1(t)| \ge 0$
$y_1''(t)= C_1.e^{t}+C_2.e^{-t} \ge 0$ for all real t
The condition of $C_1, C_2$ is that $C_1 \ge 0$ and $C_2 \ge 0$
$5)$ I test the Second situation, and I find that is impossible:
The general solution of $y_2''(t)=-y_2(t)$ is
$y_2(t) = C_3.\cos{t}+C_4.\sin{t}$
So, if $y_2(t)$ is solution for all t, implies that $y_2''(t)=|y_2(t)| \ge 0$
$y_2''(t)= -C_3.\cos{t}-C_4.\sin{t} \ge 0$ for all real t
It is impossible, unless $C_1 = C_2 = 0$ that implies $y(t) = 0$ for all real t.
$6)$ The last possibility is the Third situation, and I could not to find this
As $y(t)$ is a continuous function, when one of the solutions ceases to be valid and passes to another solution, both must be equal at these exact instants and differenciable. And I don't know how to find this. Also, I suspect we will find a multitude of solutions for the third case.
 A: This is a really nice question! We can approach in multiple ways, I will let the simplest (and boring) one for last. First note that your equation is equivalent to the system
\begin{align}
\displaystyle \frac{dy}{dt} &= x\\
\displaystyle \frac{dx}{dt} &= abs(y)
\end{align}
Second, as $abs(y)=sgn(y).y$, we can use an analytic aproximation to the $sgn$ function, for example:
\begin{align}
\displaystyle sng(y)=\lim_{a\to 0}\frac{y}{\sqrt {a^2+y^2}}\\
\end{align}
So our system is a limit of
\begin{align}
\displaystyle \frac{dy}{dt} &= x\\
\displaystyle \frac{dx}{dt} &= \frac{y^2}{\sqrt {a^2+y^2}}
\end{align}
And a first integral can be found
\begin{align}
\displaystyle \frac{dx}{dy} &= \frac{y^2}{x\sqrt {a^2+y^2}}
\end{align}
That is
\begin{align}
\displaystyle y\sqrt {a^2+y^2}-a^2\ln\left(2y+\sqrt {a^2+y^2}\right) &= x^2+C
\end{align}
The niciest about this is that the solutions of the 'a-dependent' system converge very fast to solutions of the limit system. Here are exact solutions to original system in red and solutions to 'a-dependent' system with $a=0,1$.

Another approach is 'glue' together the two linear systems:
\begin{align}
\displaystyle \frac{dy}{dt} &= x\\
\displaystyle \frac{dx}{dt} &= y
\end{align}
for $y>0$, and
\begin{align}
\displaystyle \frac{dy}{dt} &= x\\
\displaystyle \frac{dx}{dt} &= -y
\end{align}
for $y\le0$. So you have solutions of the form $y=C_1e^t + C_2e^{-t}$ in the upper half plane, and solutions of the form $y=D_1\cos t + D_2\sin t$ in the lower half plane. If an initial condition is in the region $y'+y\ge0$ $\cap$ $y\ge0$, it will not pass the line $y=0$ so the solution is only exponential. In other cases you have to 'match' two or three IVP's. The solutions 'glue' in a 'nice way' because the vector field is continuous.
For clarification, consider as example the IVP with $y(0)=1$ and $y'(0)=-2$. We have
$y(0)=C_1e^0 + C_2e^{-0}=C_1 + C_2=1$ and $y'(0)=C_1e^0 - C_2e^{-0}=C_1 - C_2=-2$, that is: $C_1=-1/2$ and $C_2=3/2$. The solution $y=(-1/2)e^t + (3/2)e^{-t}$ crosses the line $y=0$ when $t=(1/2)\ln3$. Also $y'((1/2)\ln3)=-\sqrt 3$.
In this point you 'start' a new IVP for $y=D_1\cos t + D_2\sin t$ subject to $y((1/2)\ln3)=0$ and $y'((1/2)\ln3)=-\sqrt 3$. After finding $D_1$ and $D_2$ you find when the solution crosses the $y=0$ line again and solve the last IVP.
