I know that there is a morphism of schemes between $\mathbb{A}_k^{n+1}-\{0\}$ and $\mathbb{P}_k^n$, where $k$ is a field, given by $$(x_0,...,x_n) \to [x_0,...,x_n].$$
But, how can I strictly prove that this is a morphism of schemes? In other words, how can I define the maps between the affine schemes and check that they glue?
The scheme $\mathbb A^{n+1}_k - \{0\}$ has an open cover by the $n+1$ affine schemes $D(x_i)$, whose coordinate rings are the $k[x_1, \dots, x_{n+1}][x_i^{-1}]$, and the scheme $\mathbb P^n_k$ has an open cover by the $n+1$ affine schemes $D_+(x_i)$, whose coordinate rings are $k[y_1, \dots, y_{i-1}, y_{i+1}, \dots, y_{n+1}]$, where $y_j = x_j/x_i$, $y_j$ omitted. Define a map
$$k[y_1, \dots, y_{i-1}, y_{i+1}, \dots, y_{n+1}] \to k[x_1, \dots, x_n][x_i^{-1}]$$
by $y_j \mapsto x_j$. The spec of this map is a map $D(x_i) \to D_+(x_i)$, and by composing with the inclusion you get a map $D(x_i) \to \mathbb P^n$. Now try to show that these coincide on the intersections, using the fact that these intersections are $D(x_ix_j)$.