  We study removable sets for Newtonian Sobolev functions in metric measure
spaces satisfying the usual (local) assumptions of a doubling measure and a
Poincar\'e inequality. In particular, when restricted to Euclidean spaces, a
closed set $E\subset \mathbf{R}^n$ with zero Lebesgue measure is shown to be
removable for $W^{1,p}(\mathbf{R}^n \setminus E)$ if and only if $\mathbf{R}^n
\setminus E$ supports a $p$-Poincar\'e inequality as a metric space. When
$p>1$, this recovers Koskela's result (Ark. Mat. 37 (1999), 291--304), but for
$p=1$, as well as for metric spaces, it seems to be new. We also obtain the
corresponding characterization for the Dirichlet spaces $L^{1,p}$. To be able
to include $p=1$, we first study extensions of Newtonian Sobolev functions in
the case $p=1$ from a noncomplete space $X$ to its completion $\widehat{X}$.
  In these results, $p$-path almost open sets play an important role, and we
provide a characterization of them by means of $p$-path open, $p$-quasiopen and
$p$-finely open sets. We also show that there are nonmeasurable $p$-path almost
open subsets of $\mathbf{R}^n$, $n \geq 2$, provided that the continuum
hypothesis is assumed to be true.
  Furthermore, we extend earlier results about measurability of functions with
$L^p$-integrable upper gradients, about $p$-quasiopen, $p$-path and $p$-finely
open sets, and about Lebesgue points for $N^{1,1}$-functions, to spaces that
only satisfy local assumptions.
