Let $\Omega \subseteq \mathbb R^n, \Omega \neq \emptyset$ be open and bounded. For a continuous function $f: \partial \Omega \to \mathbb R$, we define the following function $\mathcal P[f](x): \overline \Omega \to \mathbb R$ via
$$\mathcal P[f](x) := \sup\{u(x) : u \in S_f\}$$
where $S_f$ is the set of "subfunctions" with respect to $f$ (i.e. the set of all continuous functions $u: \overline \Omega \to \mathbb R$ which are subharmonic on $\Omega$ and for which we have $u \mid_{\partial \Omega} \leq f$).
I now want to show: let $f: \partial \Omega \to \mathbb R$ be continuous. Then the Dirichlet problem
$$ \begin{cases} \Delta u = 0 & \text{on } \Omega \\ u \mid_{\partial \Omega} = f \end{cases} \tag{D}$$
has a solution on $\Omega$ if and only if $\mathcal P[-f] = - \mathcal P[f]$ on $\overline \Omega$.
For the direction "$\Leftarrow$", I'm given the hint I should first show that $P[f] \mid_{\partial \Omega} = f$.
I'm not really sure how to approach any of these directions. For the direction "$\Leftarrow$", I have a theorem which gives me that $\mathcal P[f](x)$ is harmonic, so I if I show that $P[f] \mid_{\partial \Omega} = f$ like mentioned in the hint, then it would immediately follow that $\mathcal P[f](x)$ solves the given Dirichlet problem. I don't really know though how I can derive $P[f] \mid_{\partial \Omega} = f$ from $\mathcal P[-f] = - \mathcal P[f]$.
Conversely, if I assume that $u$ is a solution of the given Dirichlet problem, I'd guess I'd also have to show that $\mathcal P[f](x) = u$, and then somehow derive $\mathcal P[-f] = - \mathcal P[f]$ by that? But I can't seem to work out the details for that direction either. I have standard tools like the maximum principle, Louisville's theorem for harmonic functions, etc. at my disposal, and I'd guess I'll need to use one of those at some point, but I'm not really sure how.