I am aware of the result that a measurable function $f\in L^p(\mathbb{R}^d)$ can be approximated with simple functions of the form $f=\sum_{k=1}^{\infty}c_k\chi_k$
However, I am interested in the following:
Given some function $f\in L^p(\mathbb{R}^d)$, how can we explicitly construct a sequence of function converging uniformly (or at least almost everywhere) to $f$?
For my purposes, I am ok with considering compact subsets $K\subset \mathbb{R}^d$, and continuous functions $C([a,b])$ (although the general result would be nice).
Hint: If $f$ is defined in a compact its range is a compact and thus contained in some finite interval $I = [-A,A]$. Divide it in $n$ intervals $I_j$ of length $2|A|/n$. Their preimages are disjoint sets ready for building a simple function.