Suppose $f\in L^1(\Omega)$, where $\Omega\subset \Bbb R^n$ with $|\Omega|<\infty$. Let's consider a (probably not unique) constant function $c$ such that $$ \int_\Omega |f-c|\,d \mu = \inf_{t\in\Bbb R} \int_\Omega |f-t|\,d \mu, $$ what can be said about $c$?
More generally, let $Y = \text{span}\{g\}$ for some $g\in L^1(\Omega)$. How do we determine at least one projection of $f$ onto $Y$, i.e. determining a $c \in \Bbb R$ such that $$ \int_\Omega |f-cg|\,d \mu = \inf_{t\in\Bbb R} \int_\Omega |f-tg|\,d \mu, $$ and what can be said about the set of all such $c$?
The similar problem of minimizing similar expression in $L^2$, i.e. finding $c$ such that $ \int_\Omega |f-c|^2\,d \mu = \inf_{t\in\Bbb R} \int_\Omega |f-t|^2\,d \mu, $ since $c$ is just the average of $f$ on $\Omega$. However, the $L^1$ norm is not strictly convex and such a $c$ need not even be unique.
Proving that at least one such $c$ exists shouldn't be difficult, but is there a characterization of the set of all the minimizers?
Edit I misread the question. I post a correction. This is not a solution.
In the case of $\Omega$ being a probability space and $g = 1_\Omega$ the constant functions. I think the characterization is the minimizing $c$ is given by the set of medians. I.e. $c$ such that $$ \mu\{ x \in \Omega : f(x) \geq c ) \geq \frac12 \mbox{ and } \mu\{ x \in \Omega : f(x) \leq c \} \geq \frac12. $$ See: https://en.wikipedia.org/wiki/Median and The Median Minimizes the Sum of Absolute Deviations (The $ {L}_{1} $ Norm)
There is a more general notion of conditional mean with respect to a $\sigma$-algebra defined in [T]. You could take the $\sigma$-algebra $\Sigma_g$ generated by $g$ and take its conditional medians, but there would be elements in $L^1(\Omega;\Sigma_g)$, which is in principle much larger that $t \cdot g$.
[T] Tomkins, R. J., On conditional medians, Ann. Probab. 3, 375-379 (1975). ZBL0307.60002.