A more constructive demonstration: for any complexity class $X$ (not just for $P$), any problem $P_X$ in $X$ can be solved by an $X$-algorithm (that's the definition).
If it can be solved by an $X$-algorithm, it's simple to extend that algorithm to output one of two different values depending on whether the solution is yes or no - unless your complexity class is so extremely restrictive that outputting a constant string is too hard for it - which $P$ is not.
Now choose any other problem $Q_Y$ in any complexity class $Y$ which has at least one instance whose answer is "yes" and at least one instance whose answer is "no".
Now extend your algorithm for $P_X$ so that if the answer is "yes" it outputs a known (hard-coded) instance of $Q_Y$ whose answer is "yes" and if the answer is "no" it outputs a known (hard-coded) instance of $Q_Y$ whose answer is "no".
You have now constructed an algorithm which reduces $P_X$ to $Q_Y$. And this applies for every $P_X$ and every non-trivial $Q_Y$, in most complexity classes $X$ and all complexity classes $Y$. You could reduce nearly anything to nearly anything this way.
And here's an actual instance of that. Here's an $NP$-algorithm that reduces SAT to the problem of determining whether an integer is less than five. The reduction algorithm works like this:
- Solve the satisfiability problem instance (in $NP$ time).
- If the instance is satisfiable, output 4.
- If the instance is unsatisfiable, output 6.
Seems silly, right? That's why we don't define it that way.