$f$ is a square-integrable function, $ \|f(x+h)-f(x)\|_{L^2}=O(h^{1+\alpha}), h\rightarrow 0. $
So, let the domain be $\mathbb R$. First, note that the definition of $$\|f(x+h)-f(x)\|_{2} = O(h^{1+\alpha}) \\\iff \exists h',C>0 , h<h' \implies \|f(x+h)-f(x)\|_{2} \leq Ch^{1+\alpha}$$
Now, it's quite clear from here that $\left\|\frac{f(x+h)-f(x)}{h}\right\|_{2} \leq Ch^{\alpha}$ for $h<h'$. Therefore, let $g_h(x) = \frac{f(x+h)-f(x)}{h}$, we know that $\|g_h(x)\|_{L^2} \to 0$ as $h \to 0$, and therefore, we know that $g_h(x) \to 0$ in $L^2(\mathbb R)$.
Now, let $\psi$ be any smooth function with compact support. We can use a change of variables to write :$$ \int_{\mathbb R} \psi(x)g_h(x)dx = \frac 1h\int_{\mathbb R} \psi(x)f(x+h)dx - \frac 1h \int_{\mathbb R} \psi(x)f(x)dx \\ = \frac 1h \int_{\mathbb R} \psi(x-h)f(x)dx - \frac 1h\int_{\mathbb R} \psi(x)f(x)dx \\ =\int_{\mathbb R} \frac{\psi(x-h)-\psi(x)}{h}f(x)dx $$
Now, as $h\to 0$ , the LHS goes to zero as $g_h \to 0$ in $L^2(\mathbb R)$, so a Cauchy-Schwarz will do the trick. Therefore, the RHS goes to zero as well. However, on the RHS, the point is that we can interchange the $h$-limit and the integral over $\mathbb R$.
To prove this, we use the bounded convergence theorem. Let $D = \overline{\{x : \psi(x) \neq 0\}}$ be the support of $\psi$. It's a compact set, and by Holder's inequality$$ \|f\|_{L^1(D)} \leq \|f\|_{L^2(D)}\|1\|_{L^2(D)} < \|f\|_{L^2(\mathbb R)}\mu(D)^{\frac 12} < \infty $$ We also have $$ \frac{\psi(x-h)-\psi(x)}{h} \leq \sup_{x \in D} |\psi'(x)|<\infty $$ therefore, the RHS is uniformly bounded in $x$ and $h$ by $\|f\|_{L^2(\mathbb R)}\mu(D)^{\frac 12}\sup_{x \in D} |\psi'(x)|$, a finite quantity. Thus, the interchange of the $h$-limit and the integral is justified and $$ \lim_{h \to 0} \int_{\mathbb R} \frac{\psi(x-h)-\psi(x)}{h}f(x)dx = \int_{\mathbb R}\lim_{h \to 0} \frac{\psi(x-h)-\psi(x)}{h}f(x)dx \\ = \int_{\mathbb R} \psi'(x)f(x)dx $$
Combining this with the previous observation that $\int_{\mathbb R} \psi(x)g_h(x) \to 0$, it follows that for all $\psi \in L^2(\mathbb R)$ smooth with compact support, we have $\int_{\mathbb R}\psi'(x)f(x)dx = 0$. It follows that $f$ is weakly differentiable with weak derivative zero on $\mathbb R$ : that implies that $f$ is constant a.e, using a mollifiers-based argument as presented here.