Definition of integrability
A dissection $\mathcal D$ of $[a,b]$ is a finite subset of $[a,b]$ containing the endpoints $a,b$.
We write a dissection as $\set{x_0, x_1, \ldots, x_n}$ where $a=x_0 < x_1 < \ldots < x_n = b$.
For a bounded function $f: [a,b] \to \R$ and a dissection $\mathcal D$, the associated Riemann upper and lower sums are $$ \begin{align*} U(f,\mathcal D) &= \sum_{j=1}^{n} (x_{j} - x_{j-1}) \sup_{x\in[x_{j-1},x_{j}]} f(x), \\ L(f,\mathcal D) &= \sum_{j=1}^{n} (x_{j} - x_{j-1}) \inf_{x\in[x_{j-1},x_{j}]} f(x). \end{align*} $$
Suppose $\mathcal D_1$ and $\mathcal D_2$ are two dissections of $[a,b]$ and $f:[a,b]\to\R$ is bounded.
Then $L(f,\mathcal D_1) \leq U(f, \mathcal D_2)$.
For a bounded function $f$, the upper and lower integrals are $$ \begin{align*} I^\star(f) &= \inf_{\mathcal{D}} U(f,\mathcal{D}), \\ I_\star(f) &= \sup_{\mathcal{D}} L(f,\mathcal{D}). \end{align*} $$ (Proof of existence of supremum and infimum)
For any bounded function $f$, we have $I_\star(f) \leq I^\star(f)$.
A bounded function $f:[a,b]\to\R$ is (Riemann) integrable if $$ \begin{align*} I^\star(f) = I_\star(f). \end{align*} $$ We define the integral of $f$ $$ \begin{align*} \int_{a}^{b} f \equiv \int_{a}^{b} f(x) \, dx \equiv I^\star(f) = f_\star(f). \end{align*} $$