Starting from
$y'' = f(y), \tag 1$
we multiply through by $y'$:
$y''y' = f(y)y'; \tag 2$
we observe that
$\dfrac{1}{2}((y')^2)' = \dfrac{1}{2} (2y'y'') = y'y'', \tag 3$
whence (2) may be written
$\dfrac{1}{2}((y')^2)' = f(y)y', \tag 4$
or
$((y')^2)' = 2f(y)y'; \tag 5$
we integrate with respect to $x$:
$(y')^2 = \displaystyle \int ((y')^2)' \; dx + C_1$
$= 2 \displaystyle \int f(y)y' \; dx + C_1 = 2 \int f(y) \; dy + C_1; \tag 6$
we isolate $y'$:
$\dfrac{dy}{dx} = y' = \pm \left (2 \displaystyle \int f(y) \; dy + C_1 \right)^{1/2}, \tag 7$
whence
$\dfrac{dx}{dy} = \pm \left (2 \displaystyle \int f(y) \; dy + C_1 \right )^{-1/2}; \tag 8$
we may now integrate again over $y$:
$x + C_2 = \displaystyle \int \dfrac{dx}{dy} \; dy = \pm \int \left (2 \int f(y) \; dy + C_1\right )^{-1/2} \; dy, \tag 9$
or
$\pm(x + C_2) = \displaystyle \int \dfrac{dx}{dy} \; dy = \int \left (2 \int f(y) \; dy + C_1\right )^{-1/2} \; dy; \tag{10}$
we may absorb the $\pm$ sign into $C_2$ since it is an arbitrary constant, and write
$\pm x + C_2 = \displaystyle \int \dfrac{dx}{dy} \; dy = \int \left (2 \int f(y) \; dy + C_1\right )^{-1/2} \; dy, \tag{11}$
which is essentially identical to the formula given by our OP John Dumancic in the body of the question itself.