Imagine I have a continuum of different goods indexed by $\omega \in [0,1]$. I have a household which consumes a quantity $C(\omega)$ of good $\omega$, and pays a price $P(\omega)$. The household has a budget equal to 1, and has a linear utility function.
$$U(C) = \int_{0}^1 C(\omega) d\omega $$
The consumer chooses her consumption bundle by solving the problem
$$\max_{C} U(C) $$ $$ \text{Subject to}: \int_{0}^1 P(\omega) C(\omega) d\omega \leq 1.$$
My question is with regards to the fact that this problem seems ill-defined. If I were to go ahead solve the optimization problem, I would have the consumer choose
$$C(\omega) = \begin{cases} \frac{1}{P(\omega)} \text{ if } P(\omega) = \min_{\omega'} P(\omega') \\ 0 \text{ otherwise.} \end{cases}$$
However, this means that $U(C) = \int_{0}^1 C(\omega) d\omega = 0$, and $\int_{0}^1 P(\omega)C(\omega) = 0$ since $C(\omega) = 0$ almost everywhere.
Is there a mathematically more robust way of defining this problem? One approach I've seen is using Dirac delta functions, but I'm not sure that's right. That is, defining
$$U(C) = \int_{0}^1 C(\omega) \delta_{\omega} d\omega$$ where $\delta(\omega)$ is a ``function'' which is equal to $+\infty$ at $\omega$ and $0$ everywhere else.