Why do we need to define Lebesgue spaces using equivalence classes?

When we define an $L^{p}$ space for $1\leq p \leq \infty$, we say elements of this space are equivalence classes of functions which are equal almost everywhere and $$ \int|f|^{p} dx < \infty $$

Why can we not say elements are functions which satisfy $ \int|f|^{p} < \infty $ ?

I understand that if $g=f$ a.e. then $ ||f||_{L^{p}} = ||g||_{L^{p}} $ is this the reason for it?

EDIT :

The reason for asking is because I am studying an optimal control of PDEs course which says we need to be careful when considering the PDE :

$ -\Delta y = f $ on $ \Omega $

$ y=0 $ on $ \partial \Omega $

...since we need to define what it means for $ y=0 $ on $\partial\Omega$, since $\partial\Omega$ has zero measure.


Solution 1:

In order for the $L^p$-norm to truly be a norm, it needs to be true that $\| f \|_{L^p} = 0 \implies f = 0$. But if $f$ is a measurable function and $\int |f|^p \, dx = 0$, we can only conclude that $f$ is zero almost everywhere.