I think I have a solution to the ode $y'' = y^2$ but when I substitute my answer in it doesn't work out too well. My ansatz is that $y = e^{pt}$ from there we get:
$p^2e^{pt}-e^{2pt} = 0$
$e^{pt}(p^2-e^{pt}) = 0$
$e^{pt}$ cannot equal zero so $p^2-e^{pt}=0$
We can $p$ the subject of the formula with lambert's function.
$p=-2W_n(-t/2)/t$
Substituting this in we get $e^{-2W_n(-t/2)}$ but if we substitute this in the differential equation $y^2$ will not be equal to $y''$.
I did see that somebody else asked this question here:Solve $y''=y^2$ But I would like to know why the way I went about doing it is not right?
When you differentiated $e^{pt}$ you assumed that $p$ is costant with respect to $t$, then you can't substitute it with a function in $t$.
If $p(t)$ is a two-times differentiable function in $t$ and $y(t)=e^{p(t)}$ you have $$ y'(t)=p'(t)e^{p(t)}\\ y''(t)=p''(t)e^{p(t)}+[p'(t)]^2e^{p(t)} $$ and you have $$ p''(t)+[p'(t)]^2=e^{p(t)} $$
In other words you forgot the second-order term, for this reason your approach didn't work.