4. Given that $x, y$ are positive real numbers, then $\max \left\{\min \left\{x, \frac{1}{y}, \frac{1}{x}+y\right\}\right\}=$ $\qquad$
Thus, $m \leqslant \frac{1}{m}+\frac{1}{m}$, solving this yields $0<m \leqslant \sqrt{2}$. When and only when $x=\frac{1}{y}=\sqrt{2}$, i.e., $x=\sqrt{2}, y=\frac{\sqrt{2}}{2}$, we have $\max \left\{\min \left\{x, \frac{1}{y}, \frac{1}{x}+y\right\}\right\}=\sqrt{2}$.