According to Arthur Engel, "Problem Solving Strategies", this problem goes back to Erdős, but I cannot find the solution:
Let $A$ and $B$ be two non-overlapping squares inside a unit square, of side lengths $a$ and $b$, respectively. Prove that $$a+b \le 1$$
EDIT: Since this question received an ingenious answer, I asked a new question regarding the sum of the perimeters of five squares (the cases of 3 or 4 squares are now trivial). Maybe someone of you knows how to proceed in this case.
Given two nonoverlapping squares in a large square $Q$ there is a line $g$ separating the two squares. Assume $g$ is not parallel to one of the sides of $Q$ (otherwise we are done). Let $A$ and $C$ be the two vertices of $Q$ farthest away from $g$ on the two sides of $g$. The two edges of $Q$ meeting at $A$ together with $g$ determine a rightangled triangle $T_A$, and similarly we get a rightangled triangle $T_C$; see the following figure. (One could draw a second figure where $g$ cuts off just one vertex $A$. The proof remains the same.)
To finish the proof we need the following
Lemma. Given a triangle $T_C$ with a right angle at $C$ the largest square inscribed in $T$ is the square with one vertex at $C$ and one vertex at the intersection of the angle bisector at $C$ with the hypotenuse of $T$.
Sketch of proof of the Lemma:
Put $C$ at the origin of the $(x,y)$-plane, and let $(a,0)$, $(0,b)$ be the other two vertices of $T$. We may assume two vertices of the inscribed square on the legs of $T$. If $(u,0)$ and $(0,v)$ are these two vertices the other two vertices are $(u+v,u)$ and $(v,u+v)$. It follows that $u$ and $v$ have to satisfy the conditions $$u\geq0, \quad v\geq 0,\quad {u+v\over a}+{u\over b}\leq 1,\quad {v\over a}+{u+v\over b}\leq 1\ .$$ These four conditions define a convex quadrilateral $P$ in the "abstract" $(u,v)$-plane. The vertices of $P$ are $$V_1=(0,0),\quad V_2=\Bigl({ab\over a+b},0\Bigr),\quad V_3=\Bigl({a^2b\over a^2+ab +b^2},{ab^2\over a^2+ab +b^2}\Bigr), \quad V_4=\Bigl(0,{ab\over a+b}\Bigr)\ .$$ Computation shows that $$|V_2|^2-|V_3|^2={a^4 b^4 \over(a+b)^2(a^2+ab+b^2)^2}>0\ .$$
Therefore $u^2+v^2$ ($=$ the square of the side length of our square) is maximal at the two vertices $V_2$ and $V_4$ of $P$, which correspond to the statement of the Lemma.