I tried to solve it this way: $$x+(p/x)=t$$ $$x^2+2p+(p/x)^2=t^2$$ $$x^2+(p/x)^2=t^2-2p$$ Because both $x^2,(p/x)^2\ge0$, the whole left side should be $\ge0$. But because it's an equation, this means that
$t^2-2p≥0\\(t-\sqrt{2p})(t+\sqrt{2p})\ge0$
Therefore $t\in(-\infty,-\sqrt{2p}\ ]\cup[\sqrt{2p}, +\infty)$.
My answer is incorrect. What am I doing wrong?
Let $t=-x$. Consider $$y=-(t+\frac{p}{t})$$ Clearly, $$\text{max}(y)=-1*\text{min}(t+\frac{p}{t})=-2\sqrt p\ \ \text{by AM-GM}$$ Note that it occurs when $t=p/t$, or $t=\sqrt p$ ($x=-\sqrt p$)
The problem with your solution was that you simply put $t^2-2p\geq 0$. But, can $x^2+p^2/x^2$ even attain the value 0? The answer is NO! It's minimum value is $2p$. So, if you $t^2-2p\geq 2p$, and proceed the way you did, you'll get the answer ;)