Let $I$ be the interval $(0, 1)$ and $u$ a distribution on $I$. I would like to prove a lemma used in this answer, i.e.,
If $u' \in L^2 (I)$ then $u \in L^2 (I)$.
There are possibly subtle mistakes that I could not recognize in my below attempt. Could you have a check on my attempt?
We fix some $\psi \in C^\infty_c (I)$ such that $\int_I \psi = 1$. For $\varphi \in C^\infty_c (I)$, we denote by $T_\varphi$ the anti-derivative of $\varphi - (\int_I \varphi) \psi$. Then $T_\varphi \in C^\infty_c (I)$ with $(T_\varphi)' = \varphi - (\int_I \varphi) \psi$ and $\|T_\varphi \|_{L^2} \le (1 + \| \psi \|_{L^2}) \| \varphi \|_{L^2}$. We have $$ \begin{align*} \langle u, \varphi \rangle &= \left \langle u, (T_\varphi)' + \left ( \int_I \varphi \right) \psi \right \rangle \\ &= - \left \langle u', T_\varphi \right \rangle + \left ( \int_I \varphi \right) \langle u, \psi \rangle, \end{align*} $$
which implies $$ \begin{align*} |\langle u, \varphi \rangle| &\le \|u' \|_{L^2} \| T_\varphi \|_{L^2} + \| \varphi \|_{L^2} |\langle u, \psi \rangle| \\ &\le [\|u' \|_{L^2}(1 + \| \psi \|_{L^2})+|\langle u, \psi \rangle|] \| \varphi \|_{L^2}, \end{align*} $$
which implies $u$ is indeed a continuous linear functional on $C^\infty_c (I)$. Notice that $C^\infty_c (I)$ is dense in $L^2 (I)$. The claim then follows from Riesz representation theorem.
As @LL3.14 remarked in a comment. This gist of the proof is the inequality $\|T_\varphi \|_{L^2} \le (1 + \| \psi \|_{L^2}) \| \varphi \|_{L^2}$ at which we use the Poincaré’s inequality, i.e.,