Take a nondecreasing rearrangement $r(x)$ of the function $f(x)$ (some discussion of this may be found at http://en.wikipedia.org/wiki/Convex_conjugate). This involves finding a measure-preserving transformation of the interval $[0,1]$ that transforms $f$ into $r$. In particular, your integrals $\int_0^1\frac 1 {|f(x)-a|}\, dx$ are all preserved (for every $a$). Now apply the result that every monotone function is a.e. differentiable (see http://en.wikipedia.org/wiki/Monotonic_function). Take a point $p$ where the function $r$ is differentiable. Then $a=r(p)$ does the trick, because $r(x)-a$ can be bounded in terms of a linear expression.

Note that the existence of a nondecreasing rearrangement of a function $f$ admits an elegant proof in the context of its hyperreal extension $^\star f$, which we will continue to denote by $f$. Namely, take an infinite hypernatural $H$ and consider a partition of the hyperreal interval $[0,1]$ into $H$ segments, by means of partition points $0, \frac{1}{H}, \frac{2}{H}, \frac{3}{H}, \ldots, \frac{H-1}{H}, 1$. Now rearrange the values $f(\frac{i}{H})$ of the function at partition points in increasing order, and permute the $H$ segments accordingly. The standard part of the resulting function is the desired monotone function $r$.

Note 1. I should point out that one does not really need to use the result that monotone functions are a.e. differentiable. Consider the convex hull of the graph of $r(x)$, and take a point where the graph touches the boundary of the convex hull (other than the endpoints 0 and 1). Setting $a$ equal to the $x$-coordinate of the point does the job.


Here's a proof that $\int_0^1\frac1{\lvert f(x)-a\rvert}dx = \infty$ for every $a$ in the image of $f$ and outside of a meagre set. In particular, if $f$ is not constant, then there are uncountably many such $a$ in every neighborhood of the image of $f$. [Note: I also agree that user72694's proof works fine, and is completely independent of the proof I'll give here.]

First, define $g(a)$ to be the given integral, and let $[a_0,a_1]$ be the image of $f$. Assuming that $f$ is non-constant, we have $a_0 < a_1$. Letting $b_0 < b_1$ be in $[a_0,a_1]$ then Fubini's theorem gives, $$ \int_{b_0}^{b_1}g(a)\,da= \int_{b_0}^{b_1}\!\!\!\int_0^1\frac1{\lvert f(x)-a\rvert}\,dxda =\int_0^1\!\!\!\int_{b_0}^{b_1}\frac1{\lvert f(x)-a\rvert}\,dadx=\infty. $$ Here, the integral of $1/\lvert f(x)-a\rvert$ wrt $a$ is infinite whenever $f(x)$ is in $[b_0,b_1]$ (because $1/x$ is not integrable at the origin), which happens for $x$ in a nontrivial interval, so the double integral is infinite. This means that $g$ is not integrable (and, hence, is unbounded) in any nontrivial interval $[b_0,b_1]$ in the image of $f$.

Next, for each $K > 0$, set $S_K=\lbrace a\in[a_0,a_1]\colon g(a) > K\rbrace$. As $g$ is unbounded in the neighborhood of any point, the set $S_K$ is dense in $[a_0,a_1]$. Furthermore, $S_K$ is open for each positive $K$. To see this, note that $g_n(a)\equiv\int_0^11_{\lbrace\lvert f(x)-a\rvert > 1/n\rbrace}/\lvert f(x)-a\rvert dx$ is a sequence of continuous functions increasing to $g$, so $g$ is lower semicontinuous.

Hence, we have $$ \left\lbrace a\in[a_0,a_1]\colon g(a)=\infty\right\rbrace=\bigcap_{n=1}^\infty S_n, $$ which is a countable intersection of dense open sets in $[a_0,a_1]$ so, by definition, its complement is meagre.