Let $f \in C([0,1] \times \mathbb{R})$ and there exists $0 \leq \gamma < 8$ such that for any $0 \leq x \leq 1, u,v \in \mathbb{R}$, $$|f(x,u)-f(x,v)| \leq \gamma|u-v|.$$ Let $\alpha,\beta \in \mathbb{R}$ be constants, then the differential equations $$\left\{\begin{aligned} &-u''(x)=f(x,u(x)), \quad 0<x<1, \\ &u(0)=\alpha, \; u(1)=\beta \end{aligned}\right.$$ has a unqiue solution $u \in C[0,1] \cap C^2(0,1)$.
The proof can be divided into three parts:
If $u \in C[0,1] \cap C^2(0,1)$ is the solution to the differential equations, then $u \in C^2[0,1]$.
If $u \in C[0,1] \cap C^2(0,1)$ is the solution to the differential equations, then $u$ satisfies the integral equation $$u(x)=\alpha(1-x)+\beta x+\int_0^1 G(x,\xi)f(\xi,u(\xi))\mathrm{d}\xi, \quad 0 \leq x \leq 1,$$ where $G \in C([0,1] \times [0,1])$ is defined as $$G(x,\xi):=\left\{\begin{array}{ll} \xi(1-x), &0 \leq \xi \leq x \leq 1, \\ x(1-\xi), &0 \leq x<\xi \leq 1. \end{array}\right.$$ Conversely, if $u \in C[0,1]$ is the solution to the integral equation above, then $u \in C^2[0,1]$, and $u$ is the solution to the differential equations.
Let the metric on $C[0,1]$ be sup-metric, and define $F:C[0,1] \to C[0,1]$ as $$F(u)(x)=\alpha(1-x)+\beta x+\int_0^1 G(x,\xi)f(\xi,u(\xi))\mathrm{d}\xi,$$ then $F$ is a contraction.
Proof:
$u''(x)=-f(x,u(x)) \in C[0,1] \Rightarrow u \in C^2[0,1]$.
Let $u \in C^2[0,1]$ be the solution to the differential equations. Then, by integrating, $$u'(x)-u'(0)=-\int_0^x f(\xi,u(\xi)) \mathrm{d}\xi.$$ Integrating again, we obtain $$\begin{aligned} u(x)-u(0)-xu'(0) &= -\int_0^x \mathrm{d}\eta \int_0^{\eta}f(\xi,u(\xi))\mathrm{d}\xi \\ &= -\int_0^x \mathrm{d}\xi \int_{\eta}^{x} f(\xi,u(\xi))\mathrm{d}\eta \\ &= -\int_0^x (x-\xi)f(\xi,u(\xi))\mathrm{d}\xi. \end{aligned}$$ Setting $x=1$ and using $u(0)=\alpha,u(1)=\beta$, we find $$\beta-\alpha-u'(0)=-\int_0^1(1-\xi)f(\xi,u(\xi))\mathrm{d}\xi \Rightarrow u'(0)=\beta-\alpha+\int_0^1(1-\xi)f(\xi,u(\xi))\mathrm{d}\xi.$$ Substituting $u'(0)$, we get finally $$\begin{aligned} u(x) &= \alpha+x\left[\beta-\alpha+\int_0^1(1-\xi)f(\xi,u(\xi))\mathrm{d}\xi\right]-\int_0^x(x-\xi)f(\xi,u(\xi))\mathrm{d}\xi \\ &= \alpha(1-x)+\beta x+\left[\int_0^x x(1-\xi)f(\xi,u(\xi))\mathrm{d}\xi+\int_x^1 x(1-\xi)f(\xi,u(\xi))\mathrm{d}\xi\right]-\int_0^x(x-\xi)f(\xi,u(\xi))\mathrm{d}\xi \\ &= \alpha(1-x)+\beta x+\int_x^1 x(1-\xi)f(\xi,u(\xi))\mathrm{d}\xi+\int_0^x \xi(1-x)f(\xi,u(\xi))\mathrm{d}\xi \\ &= \alpha(1-x)+\beta x+\int_0^1 G(x,\xi)f(\xi,u(\xi))\mathrm{d}\xi, \end{aligned}$$ i.e. $u$ is the solution to the integral equation $$u(x)=\alpha(1-x)+\beta x+\int_0^1 G(x,\xi)f(\xi,u(\xi))\mathrm{d}\xi, \quad 0 \leq x \leq 1$$ Conversely, if $u \in C[0,1]$ is the solution to the integral equation, then $$u(x)=\alpha(1-x)+\beta x+(1-x)\int_0^x \xi f(\xi,u(\xi))\mathrm{d}\xi+x\int_x^1 (1-\xi)f(\xi,u(\xi))\mathrm{d}\xi,$$ and so $$\begin{aligned} u'(x) &= -\alpha+\beta-\int_0^x \xi f(\xi,u(\xi))\mathrm{d}\xi+(1-x)xf(x,u(x)) \\ &\quad +\int_x^1 (1-\xi)f(\xi,u(\xi))\mathrm{d}\xi-x(1-x)f(x,u(x)) \\ &= -\alpha+\beta-\int_0^x \xi f(\xi,u(\xi))\mathrm{d}\xi+\int_x^1 (1-\xi)f(\xi,u(\xi))\mathrm{d}\xi. \end{aligned}$$ Differentiating again, we get $$u''(x)=-xf(x,u(x))-(1-x)f(x,u(x))=-f(x,u(x)) \in C[0,1]$$ so $u \in C^2[0,1]$. And since $u(0)=\alpha,u(1)=\beta$, then $u$ is the solution to the differential equations.
Let $\rho$ be the sup-metric on $C[0,1]$, and $(C[0,1],\rho)$ be the corresponding Banach space. Then $$\begin{aligned} \rho(F(u),F(v)) &= \sup_{0 \leq x \leq 1}\left|\int_0^1 G(x,\xi)f(\xi,u(\xi))\mathrm{d}\xi-\int_0^1 G(x,\xi)f(\xi,v(\xi))\mathrm{d}\xi\right| \\ &\leq \sup_{0 \leq x \leq 1}\left|\int_0^1 G(x,\xi) \mathrm{d}\xi\right|\sup_{0 \leq y \leq 1}|f(y,u(y))-f(y,v(y))| \\ &\leq \frac{1}{8}\gamma \sup_{0 \leq y \leq 1}|u(y)-v(y)| = \frac{1}{8}\gamma\rho(u,v), \end{aligned}$$ where $\frac{1}{8}\gamma \in [0,1)$. Therefore $F$ is a contraction and has a unique fixed point $u \in C[0,1]$ such that $F(u)=u$ by the Banach fixed point theorem. By the second part we can conclude that the differential equations has a unique solution $u \in C[0,1] \cap C^2(0,1)$.