Consider the Hilbert space $L^2 (1,\infty)$ and a real function $g(x)=x^2$ defined on the interval $(1,\infty)$.
Define an operator $T$ by the formula $T(f)=f \cdot g$ for all $f$ in the domain $$D(T)=\{ f \in L^2 (1,\infty); \space \space f \cdot g \in L^2 (1,\infty), \space \int_1^{\infty}f(x)\mathrm{d}x=0\}.$$
I'm trying to find the adjoint operator $T^*$, i.e. the operator defined on the set $$D(T^*)=\{h \in L^2 (1,\infty); \space \space \mathrm{the \space mapping \space} f \mapsto \langle Tf,h \rangle \mathrm{\space is \space continuous \space on \space} D(T)\}$$ such that $\langle Tf,h \rangle = \langle f,T^* h \rangle$ for every $f \in D(T), \space h \in D(T^*)$.
I managed to prove that the operator $T$ is densely defined (therefore $T^*$ is well-defined and uniquely determined) and closed (i.e. it has a closed graph).
Unfortunately, I'm unable to find a nice characterisation of the set $D(T^*)$. My approach is following:
Suppose that $h \in D(T^*)$. Then there exists a uniquely determined (thanks to the density of the domain) function $\Psi \in L^2 (1,\infty)$ such that $\langle Tf,h \rangle = \langle f,\Psi \rangle$ for all $f \in D(T)$. Using the definition of the inner product on $L^2 (1,\infty)$ we find out that for all $f \in D(T)$ $$\int_1^{\infty}f \cdot \left( \bar{h} \cdot g \space - \space \bar{\Psi} \right )=0.$$ But now I'm stuck because I can't guarantee that the function $\bar{h} \cdot g$ is in $L^2(1,\infty)$. If I knew that, then I would just say that $\bar{h} \cdot g$ is equal to $\Psi$ almost everywhere, but without that I don't know how to continue.
Thanks for any advice.
Indeed it need not be the case that $h\cdot g \in L^2(1,\infty)$, $h\cdot g$ and $\Psi$ can differ by a constant function.
It is clear that $A :=\{ h \in L^2(1,\infty) : h \cdot g \in L^2(1,\infty)\} \subset D(T^{\ast})$, and that $T^{\ast}(h) = h\cdot g$ for those $h$. Further, we note that $r \colon x \mapsto x^{-2}$ also belongs to $D(T^{\ast})$, since
$$\langle Tf, r\rangle = \int_1^{\infty} x^2f(x)r(x)\,dx = \int_1^{\infty} f(x)\,dx = 0$$
for all $f \in D(T)$, so $f \mapsto \langle Tf, r\rangle$ is clearly continuous, and we have $T^{\ast}r = 0$. So we know $A \oplus \mathbb{C}\cdot r \subset D(T^{\ast})$, and $T^{\ast}(h + \lambda r) = h\cdot g$ for $h \in A$ and $\lambda \in \mathbb{C}$.
It remains to see that $D(T^{\ast}) = A \oplus \mathbb{C}\cdot r$. For that, we first make a few abstract notes.
If $H_1, H_2$ are Hilbert spaces, $D(B)$ a linear subspace of $H_1$, and $B \colon D(B) \to H_2$ is a linear operator, we define the adjoint relation $B^{\ast}$ of $B$ by
$$\Gamma(B^{\ast}) = \bigl\{ (y,x) \in H_2 \times H_1 : \bigl(\forall u \in D(B)\bigr)\bigl(\langle Bu, y\rangle_{H_2} = \langle u, x\rangle_{H_1}\bigr) \bigr\}.$$
Then we have
$$D(B^{\ast}) = \bigl\{ y \in H_2 : \{y\} \times H_1 \cap \Gamma(B^{\ast}) \neq \varnothing\bigr\} = \bigl\{ y \in H_2 : u \mapsto \langle Bu, y\rangle_{H_2} \text{ is continuous on } D(B)\bigr\},$$
and $B^{\ast}$ is a (linear) function if and only if $D(B)$ is dense in $H_1$.
We note that $\Gamma(B^{\ast})$ is a linear subspace of $H_2 \times H_1$, and we can obtain it in a simple way from $\Gamma(B) = \{ (u,Bu) : u \in D(B)\}$. We make the product space $H_j \times H_k$ a Hilbert space by setting
$$\langle (u,v), (x,y)\rangle_{H_j \times H_k} = \langle u, x\rangle_{H_j} + \langle v,y\rangle_{H_k},$$
and define $V, I \colon H_1 \times H_2 \to H_2 \times H_1$ by $V(x,y) = (y,x)$ and $I(x,y) = (-y,x)$. One easily verifies that $V$ and $I$ are unitary isomorphisms, and that
$$\Gamma(B^{\ast}) = I\bigl(\Gamma(B)^{\perp}\bigr) = \Bigl(I\bigl(\Gamma(B)\bigr)\Bigr)^{\perp}.$$
If $B$ is injective, then $B^{-1}$ is a linear operator from a subspace of $H_2$ to $H_1$, and we have $\Gamma(B^{-1}) = V\bigl(\Gamma(B)\bigr)$, and consequently
$$\Gamma\bigl((B^{-1})^{\ast}\bigr) = I^{-1}\bigl(\Gamma(B^{-1})^{\perp}\bigr) = I^{-1}\Bigl(V\bigl(\Gamma(B)^{\perp}\bigr)\Bigr) = V^{-1}\Bigl(I\bigl(\Gamma(B)^{\perp}\bigr)\Bigr) = V^{-1}\bigl(\Gamma(B^{\ast})\bigr),$$
i.e. the adjoint (relation) of the inverse is the inverse of the adjoint.
Now we apply these considerations to $T$ and its extension $M \colon A \to L^2(1,\infty)$ (given by $M h = h \cdot g$). Clearly $T$ and $M$ are injective, and it is easy to see that $M$ is surjective, its inverse $S$ is the multiplication with $r$, which is a continuous (since $r$ is bounded) self-adjoint operator. Since $r \in L^2(1,\infty)$, the map $\tilde{S} \colon f \mapsto f\cdot r$ is a continuous operator $L^2(1,\infty) \to L^1(1,\infty)$, hence
$$R := \Biggl\{ f \in L^2(1,\infty) : \int_1^{\infty} f(x)r(x)\,dx = 0 \Biggr\}$$
is a closed hyperplane in $L^2(1,\infty)$, and clearly $R = (\mathbb{C}\cdot r)^{\perp}$. Further, one sees that $D(T) = S(R)$, and consequently $R = \operatorname{im} T$. Finally, we find
\begin{align} \Gamma(T^{\ast}) &= V\Bigl(\Gamma\bigl((T^{-1})^{\ast}\bigr)\Bigr) \\ &= V\Bigl(I\bigl(\Gamma(T^{-1})^{\perp}\bigr)\Bigr) \\ &= V\Bigl(I\bigl((\Gamma(S) \cap R\times L^2)^{\perp}\bigr)\Bigr) \\ &= V\Bigl(I(\bigl(\overline{\Gamma(S)^{\perp} + (R\times L^2)^{\perp}}\bigr)\Bigr) \\ &= V\Bigl(I\bigl(\overline{\Gamma(S)^{\perp} + (\mathbb{C}\cdot r)\times \{0\}}\bigr)\Bigr) \\ &= V\Bigl(I\bigl(\Gamma(S)^{\perp} + (\mathbb{C}\cdot r)\times \{0\}\bigr)\Bigr) \\ &= V\Bigl(I\bigl(\Gamma(S)^{\perp}\bigr)\Bigr) + (\mathbb{C}\cdot r)\times \{0\} \\ &= V\bigl(\Gamma(S^{\ast})\bigr) + (\mathbb{C}\cdot r)\times \{0\} \\ &= V\bigl(\Gamma(S)\bigr) + (\mathbb{C}\cdot r)\times \{0\} \\ &= \Gamma(M) + (\mathbb{C}\cdot r)\times \{0\}, \end{align}
where we used that $(U\cap W)^{\perp} = \overline{U^{\perp} + W^{\perp}}$ for closed subspaces $U,W$ of a Hilbert space, the sum of a closed subspace and a finite-dimensional subspace is closed, linear maps preserve the sum of subspaces ($L(U+W) = L(U) + L(W)$), and $V\bigl(I(U\times \{0\})\bigr) = U\times \{0\}$ for a linear subspace $U$.