If U is included into W, or if W is included into U, then it's obvious to say that the union of U and W is a subspace.
If the union of U and W is a subspace :
assume that neither U is included into W, nor W is included into U. Then there exist 2 elements u and w such that :
u is in U but not in W, w is in W but not in U.
Consider the sum u+w, that must be in the union of U and W (since it's a subspace).
Then you have 2 possibilities : u+w is in U, or u+w is in W.
If u+w is in U, then subtract u (which is an element of the subspace U) and prove that w is in U.
If u+w is in W, then subtract w (which is an element of the subspace W) and prove that u is in W.
In both cases, you reach a contradiction.