Prove that the sequence is a weakly convergent sequence I am trying to solve the following exercise:
Fix $a,b \in \mathbb{R}^n, 0 < \lambda < 1.$ Define
$$
u_k(x)= \left\{\begin{array}{ccc}
a & \text{if } & \frac jk \leq x < \frac{\lambda(j+1)}{k}\\ 
b & \text{if } & \frac{\lambda(j+1)}{k} \leq x < \frac{j+1}{k}
\end{array} \right.
$$
for $j = 0, \dots, k-1$
Prove $u_k \to \lambda a + (1-\lambda)b$ weakly in $L^2(0,1)$.
I don't know how to do this.
Thank you.

An outline:
First prove that the $u_k$ are bounded in $L^2$, call the bound on their norms $M$. (This is easy, since the $u_k$ are actually pointwise bounded.)
Then, given $g \in L^2$ and $\varepsilon > 0$, find a piecewise constant function $s$ with $\| g - s \|_{L^2} < \varepsilon/2M$. (This can be done because simple functions are dense and the Lebesgue measure is regular.) Now choose $K$ large enough that if $k \geq K$ then $s$ is constant on each of the pieces of $u_k$. Use this and the Cauchy-Schwarz inequality to finish the proof.
