Let $x_1$ and $x_2$ be independent uniform variables from [0, 2]. What is the probability that $|x_1-x_2| \leq 1$? What I have so far for the solution
Since they are both continuous uniform variables. And because they are independent, we can say that
$$f(x_1, x_2)=\frac{1}{4}$$
$$P(|x_1-x_2| \leq 1) = P(x_1-1 \leq x_2 \leq x_1+1)$$
$$P(x_1-1 \leq x_2 \leq x_1+1) = \int_{-\infty}^{+\infty} \int_{x_1 - 1}^{x_1 + 1}\frac{1}{4}dx_2dx_1$$
What I am having trouble with
However, when I compute the aforementioned integral, I get a probability of $1$ or $100\%$
$$\int_{-\infty}^{+\infty} \int_{x_1 - 1}^{x_1 + 1}\frac{1}{4}dx_2dx_1 = \int_{0}^{2} \int_{x_1 - 1}^{x_1 + 1}\frac{1}{4}dx_2dx_1 = 1$$
I know that I am supposed to get $\frac{3}{4}$. But I have no idea how.

In addition to the condition $x_1-1 \leq x_2 \leq x_1+1$ you have to remember that $x_2$ has to lie between $0$ and $2$. For example, if $x_1 <1$ then $x_1-1 <0$ so the integral w.r.t. $x_2$ cannot start from the negative number $x_1-1$. 
If $x_1 <1$ then the integral w.r.t. $x_2$ starts from $0$ and if $x_1 >1$ then the integal ends at $2$. So split the integral into two parts depending on whether $x_1 <1$ or $>1$. 
So you have to compute $\int_0^{1} \int_0^{x_1+1} \frac 1 4 dx_2dx_1+\int_1^{2} \int_{x_1-1}^{2} \frac 1 4 dx_2dx_1$. 
