Solution (source code)

= Solution

The operator $R$ is the <midpoint parity operator> about $a/2$. The angle-subtraction identity gives
$$
R\psi_n(x)=\sqrt{\frac2a}\sin\left(n\pi-\frac{n\pi x}{a}\right)=\boxed{(-1)^{n+1}\psi_n(x).}
$$
Consequently $HR\psi_n=RH\psi_n=E_n(-1)^{n+1}\psi_n$. The sine functions form a complete <orthonormal basis> of $L^2(0,a)$, so the simultaneous diagonal action implies commutation on the <Hamiltonian operator>'s <operator domain>. More directly, $R$ preserves the <Dirichlet boundary conditions> and $(R\psi)''(x)=\psi''(a-x)$; hence $HR\psi=RH\psi$ whenever $H\psi$ is defined. This checks the domain as well as the differential expressions.

For arbitrary $f,g\in L^2(0,a)$, use $y=a-x$ in the <inner product>:
$$
\langle f,Rg\rangle=\int_0^a f(x)^*g(a-x)\,dx=\int_0^a f(a-y)^*g(y)\,dy=\langle Rf,g\rangle.
$$
Also $\|Rf\|=\|f\|$, so $R$ is bounded and defined everywhere. The identity therefore proves $\boxed{R^*=R}$, with no extra domain restriction. In particular $R$ is a <self-adjoint operator>; $R^2=I$ also makes it a <unitary operator>.