This is an example from Axler's "Linear Algebra Done Right":
Suppose $U_j$ is a subspace of $\mathbf{F}^n$ of those vectors whose coordinates are all $0$, except possibly in the $j^\text{th}$ slot (thus, for example, $U_2 = \{ (0, x, 0, \dots, 0) \in \mathbf{F}^n | x \in \mathbf{F} \}$. Then $$\mathbf{F}^n = U_1 \oplus \dots \oplus U_n$$, as you should verify.
The definition of direct sum is given as
"The sum $U_1+\dots+U_n$ is called a direct sum if each element of $U_1 + \dots + U_m$ can be written in only one way as a sum $u_1+ \dots + u_m$, where each $u_j$ is in $U_j$."
Proof: Let $v$ be an arbitrary vector.
$(\leftarrow)$ Suppose that $v \in U_1 \oplus \dots \oplus U_n$. Then we know that $v$ can be written as $v = u_1 + u_2 + \dots + u_n$ for $u_i \in U_i$. Since each $u_i \in \mathbf{F}^n$ and $\mathbf{F}^n$ is a vector space, $v = u_1 + u_2 + \dots + u_n \in \mathbf{F}^n$ by closure under addition.
$(\rightarrow)$ Now suppose that $v \in \mathbf{F} ^ n$. Then we can write $v$ as $v = (v_1, v_2, \dots, v_n)$. For $1 \leq i \leq n$, let $u_i \in U_i$ be a vector with $v_i$ as its $i^\text{th}$ coordinate, and zero everywhere else. It follows that $v = u_1 + u_2 + \dots + u_n$, so $v \in U_1 + U_2 + \dots + U_n$. Now let $w_1 \in U_1, w_2 \in U_2, \dots w_n \in U_n$ be arbitrary such that $v = w_1 + \dots + w_n$ ...
How do I finish this part of the proof formally (it makes sense intuitively)? I was thinking of showing that $u_1 + u_2 + \dots + u_n = v = w_1 + \dots + w_n$ and $u_1 + u_2 + \dots + u_n - (w_1 + \dots + w_n) = 0$, so $(u_1 - w_1) + \dots + (u_n - w_n) = 0$, but I get stuck here. Any hints would be appreciated!