Let me try to answer the question how I understand it (basically, just to expand a bit on the comments by Harald and Willie).
Let $Df$ be a distributional derivative of thea differentiable function $f:\mathbb R\to\mathbb R$. This implies, in particular, that $Df$ is a linear continuous functional on the space of test functions $\mathcal{D}(\mathbb R)$. By definition, $Df$ can be identified with a a function a function $g:\mathbb R\to\mathbb R$ iff $$\langle Df,\phi\rangle=(g,\phi)\equiv\int_{\mathbb R} \phi(x)g(x)dx\qquad\qquad\qquad\qquad \quad(1)$$$$\langle Df,\phi\rangle=(g,\phi)\equiv\int_{\mathbb R} g(x)\phi(x)dx\qquad\qquad\qquad\qquad \quad(1)$$ for all $\phi\in\mathcal{D}(\mathbb R)$. If such $g$ exists, it is unique (up to its modifications modifications on a measure zero-zero set). Now, we want to know when $g$ exists and is equal to the classical derivative $f'$ of $f$.
So the question is: given a differentiable function $f$, when does (1) hold with $g=f'$?
First, in order for the r.h.s. ofintegral in (1) to be finite for all $\phi\in\mathcal{D}(\mathbb R)$, the function $g=f'$ must be locally integrable on $\mathbb R$ in the sense of Lebesgue, i.e. $$\int\limits_{a}^{b}|g(x)|dx=\int\limits_{a}^{b}|f'(x)|dx < \infty, \quad \forall a,b\in\mathbb R.\qquad(2)$$ In other words, the function $f$ should have bounded variation on all finite intervals $[a,b]\in\mathbb R$$[a,b]\subset\mathbb R$. Note, that $f'$ is always measurable so (2) simply means that the derivative is not too "large"wildly unbounded.
Condition (2) is necessary but not sufficient. If $f$ is of bounded variation then by Lebesgue's decomposition theorem it can be written as the $$f=f_{ac}+f_{sing}$$ where $f_{ac}$ is absolutely continuous and $f_{sing}$ is a step function. The example in Rudin's book shows. Indeed, the measure that if $d\mu(x)=|f'(x)|dx$ may fail to be absolutely continuous with respect$f_{sing}$ does not vanish then we cannot integrate by parts to the Lebesgue measure $dx$. This is the case when $d\mu$ has jumps, e.g. check outget the singular measure determined byidentity $$\int_{\mathbb R} f'(x)\phi(x)dx=-\int_{\mathbb R} f(x)\phi'(x)dx\qquad\qquad\qquad(3)$$ and Cantor's function as Willie suggested(1) also fails.
Finally, if $f$ is absolutely continuousabsolutely continuous on $\mathbb R$ (i.e. $f=f_{ac}$) then $Df$ can be identified with $f'$ as Rudin explains (roughly speaking, oneone can justify the integration by parts in (3) and get (1) with $g=f'$ in this case). This is a necessary and sufficient condition.