Let's say $\mathcal{H}=L^2([0,1])$ and $p$ is the operator $-i\frac{d}{dx}$ defined on $\mathcal{D}(p)=\{f\in L^2([0,1])\ |\ f'\in L^2, f(1)=e^{i\theta}f(0)\}$. I have to prove that $p$ is self-adjoint. However I am stucked on the technicalities of the algebra:
$$<g,pf>=\int_0^1\overline{g(x)}(-i)f'(x)dx = [\overline{g(x)}(-i)f(x)]_0^1 - \int_0^1\overline{g'(x)}(-i)f(x)dx$$
Integration by parts works only if I assume that $g$ is differentiable or weakly differentiable (and then continuous) with $g'\in L^2$. How can I know that there is not some non-differentiable $g$ for which $f\ \to\ <g,pf>$ is continuous and linear, so that $g\in\mathcal{D}(p^\dagger)$?