Prove that $f$ is Riemann integrable if and only of $I(f)=\lim_{||P||\to 0}\sum_{i=1}^nf(t_i)\Delta x_i$. Let $f:[a,b]\to \mathbb R$ a function. If $P=\{x_0,x_1,\ldots,x_n\}$ is a partition of $[a,b]$, define $$||P||=\max_{1\leq i\leq n}|x_i-x_{i-1}|.$$
Prove that, $f$ is Riemann integrable in $[a,b]$ iff $$I(f)=\lim_{||P||\to 0}\sum_{i=1}^n f(t_i)\Delta x_i$$ exist, in that case $I(f)=\int_a^b f(x)\ dx$. Where $t_i\in [x_{i-1},x_i]$.
My Try:
Let $f:[a,b]\to \mathbb R$ a function. For $P$ partition of $[a,b]$ define $$||P||=\max_{1\leq i\leq n}|x_i-x_{i-1}|.$$
Suppose that $f$ is Riemann integralbe in $[a,b]$. Let $\epsilon>0$, and $|||P|||<\delta$,Let's see what $I(f)=\int_a^bf(x)\ \text{d}x$. In fact, since $f$ is Riemann integrable, we have that $$U(f,P)-L(f,P)<\epsilon.$$ Also note that, $$L(f,P)\leq \sum_{i=1}^nf(t_i)\Delta x_i\leq U(f,P)$$ $$L(f,P)\leq \int_a^bf(x)\ \text{d}x\leq U(f,P)$$
from where it follows that, $$\left |\int_a^bf(x)\ \text{d}x-\sum_{i=1}^nf(t_i)\Delta x_i\right |\leq U(f,P)-L(f,P)<\epsilon.$$
This shows that $ I (f) $ exists, and that $ I (f) = \int_a ^ bf (x) \text {d} x $.
Is my test correct? Who helps me with the coming involvement?
 A: You are trying to prove the first implication, that if $f$ is Riemann integrable, than that limit exists and it's equal to the integral.
Your line of thought is correct, however, you are assuming that, if $f$ is Riemann integrable, than for every $\varepsilon > 0$ there exists $\delta > 0$ such that if $\mid\mid P \mid\mid < \delta$, than
$$
    U(f, P) - L(f, P) < \varepsilon
$$
That fact does not follow trivially from the definition of the Riemann Integral and should be proved. I can provide more detail on this if you'd like. The rest is fine.
Now, as to the other implication, you may try to prove that there exists a partition $P$ of $[a, b]$ such that
$$
\sum_{i=1}^{n} (M_i - m_i)\Delta x_{i} < \varepsilon
$$
Where $M_i$ and $m_i$ are, respectively, the sup and inf of $f$ in $[x_{i-1}, x_i]$.
To do that, take advantage of the fact that as long as the norm of the partition is $\delta$-small, you can tag it however you like and still the resulting Riemann sum will be $\varepsilon$-close to the integral.
A: How are you defining the Riemann integral? Your statement appears in some textbook as the definition of the Riemann intergral (See definition 3 below).
If you are using refinement of partitions to define the Riemann integral (see definitions (1) and/or (2) below) some additional considerations need to be considered as the partitions $P$ and $Q$, with small $\|P\|, \|Q\|$ may not many points in common and their comparison becomes a little tricky.

In the rest of my posting I state three  common definitions of Riemann integral. Their proof of their equivalences solves the OP.
A partition $\mathcal{P}$ of $[a,b]$ is a finite collection of points $a=x_0<x_1<\ldots<x_n=b$. Given a partition $\mathcal{P}=\{a=x_0<\ldots<x_n=b\}$ of $[a,b]$, a set of tags for $\mathcal{P}$ is collection $\tau$ of points $t_j$, $1\leq j\leq n$ such that $t_j\in[x_{j-1},x_j]$. The pair $(\mathcal{P},\tau)$, where $\mathcal{P}$ is a partition of $[a,b]$ and $\tau$ is a collection of tags for $\mathcal{P}$,  is called a tagged partition.
Suppose $f$ is a bounded function on $[a,b]$, and let $(\mathcal{P},\tau)$ be a tagged partition of $[a,b]$, $\mathcal{P}=\{a=x_0<\ldots<x_n=b\}$, $\tau=\{t_j:1\leq j\leq n\}$, $t_j\in[x_{j-1},x_j]$.
Define
$$\begin{align}
U(f,P)&=\sum^n_{j=1}M_j(x_j-x_{j-1})\\
L(f,P)&=\sum^n_{j=1}m_j(x_j-x_{j-1})\\
S(f,P,\tau)&=\sum^n_{j=1}f(t_j)(x_j-x_{j-1})
\end{align}$$
where $M_j=\sup_{x_{j-1}\leq x\leq x_j}f(x)$, and $m_j=\inf_{x_{j-1}\leq x\leq x_j}f(x)$.
It is clear that
$$L(f,P)\leq S(f,P,\tau)\leq U(f,P)$$

Defintion 1. (Darboux) $f$ is Riemann integrable over the bounded interval $[a,b]$ if
$$\sup_P L(f,P)=\inf_P U(f,P)$$
where the $\sup$ and $\inf$ are taking aver all (finite) partitions of $[a,b]$.
The common value, say $I$, is called integral of $f$ and denoted $\int^b_a f$.

Notice that in general $-m(b-a)\leq\sup_PL(f,P)\leq\inf_P U(f,U)\leq M(b-a)$.
where $m=\int_xf(x)$ and $M=\sup_xf(x)$.

Definitions 2. $f$ is Riemann integrable over the bounded interval $[a,b]$ if there exists $I\in\mathbb{R}$ such that
$$\lim_{P}S(f,P,\tau)=I$$

Meaning that for any $\varepsilon>0$, there is a partition $P_\varepsilon$ such that for any refinement $P$ of $P_\varepsilon$ (i.e, $P$ for any partition containing $P_\varepsilon$), and  any set of set of tags $\tau$ for $\mathcal{P}$
$$
|S(f,P,\tau)-I|<\varepsilon
$$

Definition 3. (Riemann) $f$ is Riemann integrable over the bounded interval $[a,b]$ if there exists $I\in\mathbb{R}$ such that
$$\lim_{\|P\|\rightarrow0}S(f,P,\tau)=I$$

Meaning that for any $\varepsilon>0$, there is $\delta>0$ such that for any tagged partition $(P,\tau)$ with $\|P\|=\sup(x_{i+1}-x_i)<\delta$
$$
|S(f,P,\tau)-I|<\varepsilon
$$

Equivalencies
Equivalence between definitions  (1) and (2) is the simplest of all.
Definition (1) implies Definition (2):  For any $\varepsilon>0$, there is a partition $P_\varepsilon>0$ with
$$ U(f,P_\varepsilon)-L(f,P_\varepsilon)<\varepsilon$$
Notice that for any partitions $P$ and $P'$ of $[a,b]$
$$
L(f,P)\leq L(f,P\cup P')\leq S(f,P\cup P',\{t_i\}),I\leq U(f,P\cup P')\leq U(f,P')
$$
Hence, for any partition $P$ containing $P_\varepsilon$, and any set of tags $\tau$ for $P$
$$ 
|S(f,P,\tau)-I|\leq U(f,P)-L(f,P)<\varepsilon
$$
Definition (2) implies Definition (1):  For any $\varepsilon>0$, there is a partition $P_\varepsilon$ such that
$$
I-\varepsilon/3 < S(f,P,\{t_i\})<I+\varepsilon/3
$$
for all partitions $P$ containing $P_\varepsilon$ and any choice of $\{t_i:t_i\in[x_i,x_{i+1}], P=\{x_i\}\}$. Taking infimum and supremum over all choices of points $\{t_i\}$ adapted to the partition $P$ we obtain
$$
I-\varepsilon/3 \leq L(f,P)\leq U(f,P)\leq I+\varepsilon/3
$$
for all partitions $P$ containing $P_\varepsilon$. The rest follows immediately by observation made at the beginning of this discussion.
The equivalence (1) and (3) requires some extra work. 
Definition (3) implies Definition (1): For any $\varepsilon>0$ there is $\delta>0$ such that for any tagged partition $(P,\tau)$ with $\|P\|<\delta$
$$I-\varepsilon< S(f,P,\tau)<I+\varepsilon$$
Taking supremum over all possible tags $\tau$ addapted to $P$ yields
$$I-\varepsilon\leq L(f,P)\leq S(f,P)\leq U(f,P_\varepsilon)\leq I+\varepsilon$$
for all partition $P$ with $\|P\|<\delta$.
Fix one such partition $P_0$. For any partition $Q$,  $P'=P_0\cup Q$ is a refinement and  $\|P'\|\leq \|P_0\|$; hence
$I-\varepsilon\leq U(f,P')\leq U(f,Q)$ and $L(f,Q)\leq L(f,P')\leq I+\varepsilon$ whence it follows that
$$I-\varepsilon\leq \inf_Q U(f,Q),\qquad \sup_Q L(f,Q)\leq I+\varepsilon$$
for all $\varepsilon>0$; therefore, $\sup_QL(f,Q)=I=\inf_QU(f,Q)$.
Definition (1) implies Definition (3): This is  a direct consequence of the following result

Lemma A: For any bounded function $f$ on $[a,b]$
\begin{align}
\lim_{\|P\|\rightarrow0}U(f,P)&=\inf_PU(f,P)\\
\lim_{\|P\|\rightarrow0}L(f,P)&=\sup_PL(f,P)
\end{align}

Proof of Lemma A:
Let $M=\|f\|_\infty$; denote by $\overline{I}=\inf_PU(f,P)$ and $\underline{I}=\sup_PL(f,P)$. Given $\varepsilon>0$ choose $P_\varepsilon$ such that
$$U(f,P_\varepsilon)\leq \overline{I}+\varepsilon,\qquad \underline{I}-\varepsilon<L(f,P_\varepsilon)$$
Let $P_\varepsilon=\{a=t_0<\ldots<t_m=b\}$. Suppose $P$ is a partition with $\|P\|<\delta:=\min(1,\varepsilon)\min\{t_k-t_{k-1}:1\leq k\leq m\}$. Consider the refinement $P'=P\cup P_\varepsilon$ of $P$ and $P_\varepsilon$.
There are two types of subintervals in $P$: those that are included in a subinterval of $P_\varepsilon$, which we denote by $P^g$; and those that are not, which we denote by $P^b$. Each subinterval in $P^g$ is also a subinterval in $P'$. On the other hand, each subinterval $J=[x_{j-1},x_j]\in P^b$ gets partitioned in exactly two subintervals by point in $P_\varepsilon$. It follows that
$$0\leq U(f,P)-U(f,P')\leq \sum_{J=[x_{j-1},x_j]\in P^b}2M(x_j-x_{j-1})<2M\varepsilon(b-a)$$
Consequently
$$ \overline{I}\leq U(f,P)\leq  U(f,P')+2M\varepsilon(b-a)<U(f,P_\varepsilon)+2M\varepsilon(b-a)<\overline{I}+\varepsilon(1+2M(b-a)
$$
Letting $\varepsilon\rightarrow0$ we get that $\lim_{\|P\|\rightarrow0}U(f,P)=\overline{I}$. A similar prove can be obtained for $\lim_{\|P\|\rightarrow0}L(f,P)=\underline{I}$.

Notes:
Lemma $A$ along with the equivalences between the definition of Riemann integral discussed above yields a seemingly simpler definition of the Riemann integral.

Proposition (4): Let $P_n=\{a+\tfrac{k(b-a)}{n}:0\leq k\leq n\}$. A bounded function $f$ on $[a,b]$ is Riemann integrable iff
$$\lim_{n\rightarrow\infty}\frac{b-a}{n}\sum^n_{k=1}f(t_{nk})$$
exists and is independent of the tags $\tau_n=\{t_{nk}:1\leq k\leq n\}$ with $a+\frac{(k-1)(b-a)}{n}\leq t_{nk}\leq a+\tfrac{k(b-a)}{n}$. The common value $I=\int^b_af$.

