Let $$-d_x^2: \{f \in L^2[0,1];f \in AC^1[0,1] , f(0)=f(1)\} \rightarrow L^2[0,1]$$ be the second derivative operator. Here $AC^1[0,1]$ is the space of functions whose first derivative is absolutely continuous.
Now we can write $-d_x^2= (-d_x) \circ d_x$, where $$A:=d_x:\{f \in L^2[0,1];f \in AC[0,1],f(0)=f(1)\} \rightarrow L^2[0,1]$$ Then we have the decomposition $-d_x^2= A^*A$. Now in Functional Analysis we have the canonical domain $$D(A^*):=\{y \in L^2[0,1]:x \mapsto \langle Ax,y \rangle \text{ continuous on D(A)} \}$$ I am wondering whether $\operatorname{ran}(A) \subset D(A^*)$, in case that we define $A$ on $$\{f \in L^2[0,1];f \in AC^1[0,1] , f(0)=f(1)\} $$ instead of $$\{f \in L^2[0,1];f \in AC[0,1],f(0)=f(1)\}$$ I think the answer should be yes, if there is any sense in the decomposition $-d_x^2= A^*A$, but I don't quite see, where this actually follows from.
The domain of $A^{\star}$ is identical to the domain of $A$ in this case. However, when you compose the two, then you get $\mathcal{D}(A^{\star}A)$ as $$ \mathcal{D}(A^{\star}A)= \{ f \in L^{2} : f\in \mathcal{D}(A) \mbox{ and } Af \in \mathcal{D}(A^{\star}) \}. $$ In particular, $f$ is twice absolutely continuous with $f(0)=f(1)$ and $f'(0)=f'(1)$ . Furthermore, $f$ is twice absolutely continuous on $[0,1]$ with $f,f',f''\in L^{2}$. That's all just consequence of the definition of the domain. With this domain $A^{\star}A$ is selfadjoint and non-negative because $(A^{\star}Af,f)=(Af,Af) \ge 0$.
To show $A^{\star}=-A$:
As you pointed out, $-A \preceq A^{\star}$ (symbol $\preceq$ means the domain on the right may be bigger, but operators agree on the smaller domain.) There are a couple of ways that work here to show $A^{\star}\preceq -A$. I like the direct approach: assume that $g \in \mathcal{D}(A^{\star})$ so that $$ (Af,g) = (f,A^{\star}g),\;\;\; f \in \mathcal{D}(A). $$ Then you start choosing test functions $f \in \mathcal{D}(A)$ carefully crafted to get you what you want. For example, if you let $0 < a-h < a \le b < b+k < 1$, then you can choose $f_{a,b,h,k}$ to be piecewise linear so that it starts at $0$ on $[a,a-h]$, ramps linearly to $1$ on $[a,b]$ and then ramps linearly back to $0$ on $[b,b+k]$. If you write the above out for this $f_{a,b,h,k}$ and the given $g$ then you arrive at $$ -\frac{1}{k}\int_{b}^{b+k}g(t)\,dt+ \frac{1}{h}\int_{a-h}^{a}g(t)\,dt=\int_{0}^{1}f_{a,b,h,k}(t)(A^{\star}g)(t)\,dt. $$ Just playing around for a bit you'll find that $G(x)=\int_{0}^{x}g(t)\,dt$ has a derivative at every point of $(a,b)$ from the right and from the left, and the two derivatives are equal. Letting $h,k\rightarrow 0$ you end up with $$ -g(b)+g(a) = \int_{a}^{b}(A^{\star}g)(t)\,dt \;\; a.e.. $$ So $g$ can be changed on a set of measure $0$ to obtain a continuous function (the right side is continuous in $a$, $b$,) and you find that $g$ is absolutely continuous with $$ -g' = A^{\star}g \;\; a.e. $$ All you have to do is plug in $f\equiv 1$ into the original adjoint equation to find that $g(0)=g(1)$ because $Af=0$. That proves that every $g \in \mathcal{D}(A^{\star})$ is also in $\mathcal{D}(A)$, and $A^{\star}g=-Ag$. So $A^{\star}\preceq -A$. That finishes the proof that $A^{\star}=-A$.