I'm trying to build a skillset for research in computational neuroscience (and loving math even more as I go along) and have just jumped into the world of differential equations – very simple ones.
One of the models I've encountered is defined by the second order differential equation:
Which when integrated (with scipy) yields oscillatory dynamics
.
I'm looking for an explanation of why oscillatory dynamics emerge from this form of differential equation. The same way the graph of $f(x)=2x$ is so clear, the best answer will relate the equation to the dynamics in such an intuitive way.

A Bit of Intuition
$\ddot{x}=-k^2x$ says that when $x\gt0$, the slope of $x$ is decreasing, and when $x\lt0$, the slope of $x$ is increasing. This means that $x$ is concave above the $x$-axis and convex below the $x$-axis. This is the behavior of a periodic function, but this behavior does not guarantee periodicity since this behavior is also exhibited by $\tanh(x)$
We need to solve the equation to prove periodicity.
Full Solution
$$ D^2+k^2=(D-ik)(D+ik)\tag{1} $$ To invert the operator $D+ik$, note that $$ \begin{align} (D+ik)u=f &\implies D\left(e^{ikx}u(x)\right)=e^{ikx}f(x)\\ &\implies u(x)=e^{-ikx}\int e^{ikx}f(x)\,\mathrm{d}x\tag{2} \end{align} $$ we can apply $(2)$ for $k$ and $-k$ to $(1)$ to get $$ \left(D^2+k^2\right)u=f \implies u(x)=e^{ikx}\int e^{-2ikx}\int e^{ikx}f(x)\,\mathrm{d}x\tag{3} $$ Setting $f(x)=0$ in $(3)$ yields $$ \begin{align} u(x) &=c_1e^{ikx}+c_2e^{-ikx}\\[6pt] &=(c_1+c_2)\cos(kx)+i(c_1-c_2)\sin(kx)\\[6pt] &=b_1\cos(kx)+b_2\sin(kx)\tag{4} \end{align} $$ where $c_1,c_2$ come from the constants of integration in $(3)$.