I strongly believe you "misheard" your homework problem, which, instead, should have been something like
"Write the parity operator in terms of the SHO hamiltonian".
The Parity operator is, of course,
$$
P= \int \!\! dx ~|-x\rangle \langle x|,
$$
manifestly hermitean and unitary, $P^2={\mathbb I}$, so that
$$
P\hat x P= -\hat x, \qquad P\hat p P= -\hat p.
$$
Nondimensionalize $\hbar=1$ for simplicity; and consider the (iconic Hadamard) action of the operator
$$
\bbox[yellow]{\hat \Pi \equiv e^{i\pi(\hat p^2+ \hat x ^2 -1)/2} }, \qquad \leadsto \\
\hat \Pi \hat x \hat\Pi^\dagger=\hat x+i\pi[(\hat p^2+ \hat x ^2 -1)/2,\hat x]\\ -(\pi^2/2)[(\hat p^2+ \hat x ^2 -1)/2,[(\hat p^2+ \hat x ^2 -1)/2, \hat x]]+... \\
=\hat x \cos\pi + \hat p \sin\pi=-\hat x,\\
\hat \Pi \hat p \hat\Pi^\dagger =... =\hat p \cos\pi - \hat x \sin\pi=- \hat p.
$$
You know about the integer spectrum of of the nondimensionalized, $m=1$, $\omega=1$, shifted SHO hamiltonian, $(\hat p^2+ \hat x ^2 -1)/2$ . This oscillator hamiltonian rotates the canonical quantum variables in a rigid circle, uniformly in time: the magic of the oscillator in phase space.
For the very same reason, you should then also appreciate, by inspection, the hermiticity, $\hat \Pi=\hat \Pi^\dagger $, and unitarity $\hat \Pi \hat \Pi^\dagger ={\mathbb I}$, of $\hat \Pi$.
So $\hat \Pi$ is really a faithful representation of $P$. To comport with your title, you might contemplate taking its logarithm, but I cannot imagine your problem willfully descended into this type of subtlety...