First of all we will show that $\int_A f \, d\lambda = 0$ for all closed sets $A \subset [0, 1]$.
Consider the function $h: x \mapsto d(x, A) = \inf \limits_{y \in A} d(x, y)$. It is easy to proof that $h$ is (Lipschitz-)continuous and $h(x) = 0 \iff x \in A$ (for the latter equality you actually need that $A$ is closed). Now we define a sequence of (uniformly) bounded functions via $g_n(x) = \min\{1, n h(x)\}$. It is easy to verify that $g_n$ converges pointwise to the indicator function of $A^c$. Since $g_n$ is uniformly bounded and $f$ integrable, the dominated convergence theorem implies
$$\int_A f \, d\lambda = \int_{[0, 1]} f \, d\lambda - \int_{[0, 1]} f I_{A^c} \, d\lambda = -\lim \limits_{n \to \infty} \int_{[0, 1]} f g_n \, d\lambda = 0$$
Now consider the set $S = \{A \subset [0, 1] \mid A \text{ is measurable and }\int_A f \, d\lambda = 0\}$. By the dominated convergence theorem, $S$ is in fact a $\sigma$-algebra and it contains all closed sets, so $S = \mathcal{B}([0, 1])$. But now we can simply choose $A = \{f > 0\}$ and we get $\int_A f \, d\lambda = 0$, which implies that $f = 0$ almost surely on $A$. Choosing $B = \{f < 0\}$ implies $f = 0$ almost surely on $B$ and both together imply $f = 0$ almost surely.