In the following picture :
1-why we need the property that $|f|^2$ is Lebesgue integrable for the given space to be a vector space, could anyone explain this for me please?
2-And why we identify functions which are equal almost everywhere, could anyone explain this for me please?

You don't need these conditions for the set of complex-valued functions on $[a,b]$ to be a vector space. You can add and scale any such functions without a problem.
You need these conditions for the $L^2$-norm of a function $$ \Vert f \Vert = \sqrt{\left<f,f\right>} = \left(\int_a^b |f|^2 \,dx\right)^{1/2} $$ to be an actual norm. In particular, $\Vert f \Vert$ must be a nonnegative real number for any $f$, and $\Vert f \Vert = 0 \iff f = 0$.