Proposition: Suppose $f:\mathbb{R}\to\mathbb{R}\ $ has the property:
$$ \exists\ \delta > 0:\quad \forall\ \varepsilon > 0,\ \vert x-y\vert < \delta \implies \vert f(x) - f(y) \vert < \varepsilon.\quad (1) $$
Then $f$ is a constant function.
Proof:
Suppose $f:\mathbb{R}\to\mathbb{R}\ $ has property $\ (1),\ $ and $f$ is non-constant, that is, $\ \exists\ x_1 \neq x_2\ $ with $\ f(x_1)\neq f(x_2).$
Let $\ \alpha = \left\lceil \frac{ \vert x_2 - x_1 \vert }{ \delta } \right \rceil + 1,\ $ so that $\ \beta: = \frac{ \vert x_2 - x_1\vert }{ \alpha } < \delta,\ $ and set $\ \varepsilon = \frac{ \vert f(x_2) - f(x_1) \vert }{ \alpha }.$
Since $\ \vert x_1 + k\beta - (x_1 + (k-1)\beta ) \vert = \beta < \delta\quad \forall\ k\in\{1,2,\ldots,\alpha\},$
$(1)\implies \vert f(x_1 + k\beta) - f(x_1 + (k-1)\beta) \vert < \varepsilon\quad \forall\ k\in\{1,2,\ldots,\alpha\}.\ $ It follows that:
$$ \vert f(x_2 - f(x_1) \vert = \left \lvert \sum_{k=1}^{k=\alpha} f(x_1 + k\beta) - f(x_1 + (k-1)\beta) \right \rvert$$ $$ \leq \sum_{k=1}^{k=\alpha} \left \lvert f(x_1 + k\beta) - f(x_1 + (k-1)\beta) \right \rvert $$
$$ < \alpha \varepsilon = \vert f(x_2) - f(x_1) \vert\ \Rightarrow \Leftarrow.$$
I would like to know: (a) if my proof is correct, as I felt confused when writing it, and (b) if there are any good alternative approaches, as my proof seems like overkill to me.
I am aware that, since $\ f\ $ has property $(1),\ f\ $ is uniformly continuous and therefore continuous also. Therefore the Intermediate Value Theorem applies to every interval $\ I\subset\mathbb{R}.\ $ However, I didn't mention these facts in my proof because I didn't use them. Maybe an alternative approach would make good use of them?
Your solution is ok.
What is interesting here is that the condition:
$$\exists\delta>0:\ \forall\varepsilon>0:\ \vert x-y\vert<\delta\implies\vert f(x)-f(y)\vert<\varepsilon$$
implies that, for that chosen $\delta$, whenever $|x-y|<\delta$ it must be $|f(x)-f(y)|<\varepsilon$ for every $\varepsilon>0$. So, $|f(x)-f(y)|$ is smaller than any positive number $\varepsilon$, so it must be zero, i.e.:
$$\exists\delta>0:\ \vert x-y\vert<\delta\implies f(x)=f(y)$$
So, the function is constant on any interval of size $\delta$, and you can see that this easily implies that it is constant on the entire $\mathbb R$.
Update The "easily implies" bit above may still require a proof. Let $x<y$: subdivide the segment $[x,y]$ by points $x_0=x<x_1<x_2<\cdots<x_{n-1}<x_n=y$ such that all $x_{k+1}-x_k<\delta$. Then, the previous consideration implies that $f(x)=f(x_0)=f(x_1)=f(x_2)=\cdots=f(x_{n-1})=f(x_n)=f(y)$.