Let $(M^n,g)$ be a Riemannian manifold with non-empty smooth boundary $\partial M$. For any two points $x,y\in M$, the distance between $x$ and $y$ may be defined as
$$ d(x,y)=\inf\_\gamma Length(\gamma), $$
where the infimum is taken over all $C^1$ curves lying in $M$. Can we prove there exists a path in the closure $\bar{M}$ which achieves $d(x,y)$? And the length-minimizing path is piecewise $C^1$? Note that since $\partial M$ is non-empty, the length-minimizing path (if exists) may intersect the boundary. Any reference for this question?



The existence of length-minimizing path between two points in a Riemannian manifold with boundary
As stated the question is unclear. What do you mean by the "closure"? Metric completion? If so, what do you mean by piecewise $C^1$? Do you know the answer when the boundary is empty? The boundary does not seem to matter here. 


The standard result of this type is the Hopf-Rinow theorem which implies that any two points in locally compact complete length space can be joined by a minimizing geodesic if they can be joined by a finite length curve. See Theorem 2.5.23 in  [Course of metric geometry](https://www.math.psu.edu/petrunin/papers/akp-papers/bbi.pdf), by Burago-Burago-Ivanov. 


Note that the metric completion of the non-complete Riemannian manifold need not be locally compact (think of the universal cover of the once-punctured Euclidean plane).


