Theory understanding of differential equations in the form $f(y,y',y'')$ I'm struggling to understand the theory behind differential equations in the form of $f(y,y',y'')=0$.
Under the hypothesis of $y'(x) \ne 0$ we can write $x=x(y)$ and consider $y$ as an independent variable.
Then if we let $y'(x(y))=p(y)$ it follows that
$$y''=\frac{\text{d}p}{\text{d}x}=\frac{\text{d}p}{\text{d}y}\frac{\text{d}y}{\text{d}x}=p \frac{\text{d}p}{\text{d}y}$$
My doubts are the following:
(1): We can write $x=x(y)$ from $y=y(x)$ because we're assuming $y'(x) \ne 0$ and so it is a consequence of the implicit function theorem?
(2): I don't understand completely why is $y''=\frac{\text{d}p}{\text{d}x}$; since $p$ is a function of $y$, shouldn't we derive it with respect to $y$? After that we get $\frac{\text{d}p}{\text{d}x}=\frac{\text{d}p}{\text{d}y}\frac{\text{d}y}{\text{d}x}$ and it seems a chain rule but this would come if $p=p(y(x))$, and so is $x$ the independent variable, not $y$.
Can someone help me understand how this is work?
I'm sorry if it is a little confusing, especially (2), but I'm having a lot of troubles to understand this; thanks in advance.

For the second question, you have:
$$p=\frac {dy}{dx}=y'$$
Then you differentiate wrt $x$:
$$ \implies y''=\dfrac {dy'}{dx}=\dfrac {dp}{dx}$$
$$ y''=\dfrac {dp}{dx}=\dfrac {dp}{dy}\dfrac {dy}{dx}=y'\dfrac {dp}{dy}=p\dfrac {dp}{dy}$$
