I am having trouble to see that dimension of a scheme is local because I have the following counter-example in mind. I have a feeling this counter-example is fake because I can't find an open neighborhood around the "trouble point" that is isomorphic to an affine scheme.
Let $X =\operatorname{Spec} k[x]$ and $Y\operatorname{Spec} k[y]$ be two lines and consider the scheme $Z$ obtained by gluing the generic point of $Y$, the prime $(0)$, to the origin of $X$, the maximal ideal $(x)$. Then $Z$, if it is indeed a scheme, should have dimension $2$, because the following is a chain of length three:
$$\text{the generic point of the X axis ⊂ the origin of the X, (x),}$$
$$\text{which is also the generic point of the Y axis ⊂ any point on the Y axis.}$$
Now, if this example were true, than dimension would not be local on irreducible components (note that $Z$ is irreducible), because one could pick several affine opens in $Z$ whose dimension is $1$. For example, $\operatorname{Spec} k[x]_x = \Bbb A_k^1 \setminus \{0\} \subset X \subset Z$.
My questions are: how can I show that $Z$ is not a scheme (i.e. that I can't pick any neighborhood around $(x_X)\sim (0_Y)$ that is isomorphic to an affine scheme), and how do I see that dimension is indeed local?
What you have described is not only not a scheme, it is not even a ringed space. What is the local ring at the glued point?
You also need to be much more specific when saying "dimension is local". For non-noetherian schemes, this could be a very ambiguous statement. Furthermore, there are two different directions to prove, and you should specify which one you are struggling with—given a chain of primes, are you trying to produce a chain of closed subsets? Or is it the other way around?
The first thing to understand is that the dimension of an affine variety, as a noetherian topological space, equals the dimension of its coordinate ring. Once that connection is clear, I would look at arbitrary varieties.