I'm now reading about the formal definition of line as the graph of the function $f(x)=f(x_0)+m(x-x_0)$ for an arbitrary $x_0$ through which the graph passes, where the constant $m$ is called slope. If we denote $a-a_0$ by $\Delta a$, it can be easily proved that $m$ for some $x_0$ is $\dfrac{\Delta f(x)}{\Delta x}$.
What makes the equation define straight lines is that if and only if the graph is a straight line does $m$ stay constant for any $x_0$.
I don't understand the intuition behind this definition.
Why does $\dfrac{\Delta y}{\Delta x}=const.$? And why only in them?
From your first equation you see that $$ m=\frac{f(x)-f(x_0)}{x-x_0} $$ so, in general, the value of $m$ is not a constant, but depends from $x$ and $x_0$.
If it is the same for any couple $x$ and $x_0$, we can chose an $x_1$ (different from $x$ and $x_0$) and we have $$ m=\frac{f(x)-f(x_0)}{x-x_0}=\frac{f(x_1)-f(x_0)}{x_1-x_0} $$
and this is the equation of a straight line passing through the points $(x_0,f(x_0))$ and $(x_1,f(x_1))$.
So, any three points of $y=f(x)$ stay on the same straight line.