Students who are beginning to learn proofs (and some seasoned pros) occasionally commit the error of assuming what they're trying to prove. My question involves assuming at the onset that a solution to a problem exists, then using that existence to get the solution you assumed existed. Two examples:
A common technique for proving that any function $f$ can be written as the sum of an even and an odd function is to assume such functions $O$ and $E$ exist, then note \begin{align*} f(x) &= E(x) + O(x) \\ f(-x) &= E(x) - O(x)\end{align*} and solve for $O(x)$ and $E(x)$.
A nested root such as $\sqrt{2+\sqrt{\vphantom{2^5}3}}$ can be written as $\sqrt{1/2} + \sqrt{3/2}$ by first assuming there exist $A$ and $B$ such that $\sqrt A + \sqrt B$ is equal to the original radical, then solving for $A$ and $B$.
In general, when and how is it legal to assume the solution to a problem exists a priori? Or do the ends justify the means? Or is there some higher structure where the existence of solutions to the two problems above, and others like them, are proven, but I haven't gotten there yet (similar to telling Calc II students that a partial fraction decomposition exists, now find it)?