First, there's something called the Riesz Representation Theorem. To understand it, start by fixing a vector $v \in H$. We can now use the dot product to define a continuous linear functional $L_v: H \rightarrow F$ by $$L_v(w) = \langle w,v \rangle.$$ What the Riesz Representation Theorem says is that every continuous linear functional $\phi:H \rightarrow F$ arises in this way! That is, given any element $\phi$ of the dual space $H^\ast$, there is some $v \in H$ so that $\phi(w) = \langle w, v \rangle$. So this is why we can sort of think as linear functionals as elements of the Hilbert space, and vice versa. In more mathematical terms, we say that the dual of $H$ is isomorphic to $H$.
Second, a note on dual spaces: I believe that typically the space $H^\ast$ is defined to be the set of continuous linear functionals. This distinction is important, as there are different types of duals. So far, I've been talking about the topological dual. However, there is an algebraic dual, which I have seen denoted $H^\star$, which is just all linear functionals $H \rightarrow F$, no continuity assumed. The Reisz Representation Theorem concerns only the topological dual. (The duals are actually the same for finite dimensional Hilbert spaces, but I don't believe the Hilbert spaces encountered in QM are.)
Third, adjoints: Given any Hilbert spaces $H, K$, and a continuous linear functional $A: H \rightarrow K$, there is a continuous linear map called the adjoint $A^\ast:K \rightarrow H$ (note that it goes the other way) that is defined by the equation $\langle Av, w \rangle = \langle v, A^\ast w \rangle$. You typically only see the case $K = H$. So no, the adjoint of an operator $A: H \rightarrow H$ is not an element of $H^\ast$, since the members of $H^\ast$ are continuous linear functionals from $H$ into $F$, and $H^\ast$ goes from $H$ into $H$.
Unfortunately, I don't know much about QM, so this last bit is just speculating on how I think the notation works. If you consider kets $|\phi \rangle \in H$ to be an element of the Hilbert space, then there is a continuous linear functional that I suppose you could call $\langle \phi |$ defined by $\langle \phi | v \rangle = \langle v, \phi \rangle.$ And conversely, given a bra $\langle \phi |$, by the Reisz Representation Theorem, there is a bra $| \phi \rangle$ so that $\langle \phi | v \rangle = \langle \phi , v \rangle.$
By the definition of the adjoint operator, we have $\langle Tv,w\rangle=\langle v,T^*w\rangle$. Hence $\langle T^2v,w\rangle=\langle Tv,T^*w\rangle$. Since $T$ is self-adjoint, $T^*=T$, and you get your result.
Best Answer
In this business, to find the (formal) adjoint of a differential operator, integrate by parts. If $T = \frac{d}{dt}$, then
\begin{align*} \langle Tf, g\rangle &= \int_0^1 f'(t)g(t)dt \\ &= f(t)g(t)\bigg|_0^1 - \int_0^1 f(t)g'(t)dt \\ &= f(t)g(t)\bigg|_0^1 - \langle f,Tg\rangle \\ &= \bigg( f(1)g(1) - f(0)g(0)\bigg) - \langle f,Tg\rangle \end{align*}
This is easier if you restrict to the space of polynomials which have $f(0) = f(1)$ (often, both zero); then, $T^* = -T$. Otherwise, as Daniel Fischer points out, you need an operator $B$ which has $\langle f, Bg \rangle = f(1)g(1) - f(0)g(0).$