[step:Compare two candidate densities on the sets where they differ]
Suppose
\begin{align*}
f:(\mathbb R,\mathcal B(\mathbb R))&\to([0,\infty],\mathcal B([0,\infty])),\\
g:(\mathbb R,\mathcal B(\mathbb R))&\to([0,\infty],\mathcal B([0,\infty]))
\end{align*}
are nonnegative Borel measurable functions such that, for every $A\in\mathcal B(\mathbb R)$,
\begin{align*}
\mu_X(A)=\int_A f(x)\,d\mathcal L^1(x)
=\int_A g(x)\,d\mathcal L^1(x).
\end{align*}
Taking $A=\mathbb R$ gives
\begin{align*}
\int_{\mathbb R} f(x)\,d\mathcal L^1(x)
=
\int_{\mathbb R} g(x)\,d\mathcal L^1(x)
=
\mu_X(\mathbb R)=1,
\end{align*}
so both integrals are finite.
Define the Borel sets
\begin{align*}
E_+&:=\{x\in\mathbb R:f(x)>g(x)\},\\
E_-&:=\{x\in\mathbb R:g(x)>f(x)\}.
\end{align*}
We prove that $\mathcal L^1(E_+)=0$. For each $m\in\mathbb N$, define
\begin{align*}
E_{+,m}:=\{x\in\mathbb R:f(x)\ge g(x)+m^{-1}\}.
\end{align*}
Then $E_{+,m}\in\mathcal B(\mathbb R)$ and
\begin{align*}
E_+=\bigcup_{m\in\mathbb N}E_{+,m}.
\end{align*}
For each $m\in\mathbb N$, the pointwise inequality on $E_{+,m}$ gives
\begin{align*}
\int_{E_{+,m}} f(x)\,d\mathcal L^1(x)
\ge
\int_{E_{+,m}} g(x)\,d\mathcal L^1(x)
+
m^{-1}\mathcal L^1(E_{+,m}).
\end{align*}
But the density identities applied to $A=E_{+,m}$ give
\begin{align*}
\int_{E_{+,m}} f(x)\,d\mathcal L^1(x)
=
\int_{E_{+,m}} g(x)\,d\mathcal L^1(x).
\end{align*}
Since both integrals are finite, subtraction yields
\begin{align*}
m^{-1}\mathcal L^1(E_{+,m})=0,
\end{align*}
and therefore $\mathcal L^1(E_{+,m})=0$. Countable subadditivity of $\mathcal L^1$ gives
\begin{align*}
\mathcal L^1(E_+)
\le
\sum_{m\in\mathbb N}\mathcal L^1(E_{+,m})
=0.
\end{align*}
The same argument with $f$ and $g$ interchanged gives $\mathcal L^1(E_-)=0$. Hence
\begin{align*}
\{x\in\mathbb R:f(x)\ne g(x)\}=E_+\cup E_-
\end{align*}
has $\mathcal L^1$-measure zero. Thus $f=g$ $\mathcal L^1$-a.e., proving uniqueness of the density up to equality $\mathcal L^1$-a.e.
[/step]