  We study the obstacle problem for integro-differential operators of order
$2s$, with $s\in (0,1)$. Our main result establishes that the free boundary is
$C^{1,\gamma}$ and $u\in C^{1,s}$ near all regular points. Namely, we prove the
following dichotomy at all free boundary points $x_0\in\partial\{u=\varphi\}$:
  (i) either $u(x)-\varphi(x)=c\,d^{1+s}(x)+o(|x-x_0|^{1+s+\alpha})$ for some
$c>0$,
  (ii) or $u(x)-\varphi(x)=o(|x-x_0|^{1+s+\alpha})$,
  where $d$ is the distance to the contact set $\{u=\varphi\}$. Moreover, we
show that the set of free boundary points $x_0$ satisfying (i) is open, and
that the free boundary is $C^{1,\gamma}$ and $u\in C^{1,s}$ near those points.
  These results were only known for the fractional Laplacian \cite{CSS}, and
are completely new for more general integro-differential operators. The methods
we develop here are purely nonlocal, and do not rely on any monotonicity-type
formula for the operator. Thanks to this, our techniques can be applied in the
much more general context of fully nonlinear integro-differential operators: we
establish similar regularity results for obstacle problems with convex
operators.
