Here is a hint:
Suppose $\phi(x) = \begin{cases} ax, & x < 0 \\
bx, & x \ge 0 \end{cases}$, note that we can write
$\phi(x) = {b-a \over 2} |x| + {a+b \over 2} x$.
I think it is possible for the function to be discontinuous on a dense set, and differentiable almost everywhere. Here is my example.
Let $f_n(x) = 2^{-n} [2^n x]$, that is, the least multiple of $2^{-n}$ less than or equal to $x$. Note that for any $x,y$ we have $|f_n(x) - f_n(y)| \le |x-y| + 2^{-n}$.
Let
$$ g = \sum_{n=0}^\infty 2^{-2n} f_n .$$
Clearly $g$ is discontinuous at numbers of the form $\frac{k}{2^n}$.
Let
$$ E_n := \bigcup_{k=0}^{2^n-1} [\tfrac k{2^n} + \tfrac1{2^{2n}}, \tfrac {k+1}{2^n} - \tfrac1{2^{2n}}] .$$
Note that the measure of $[0,1] \setminus E_n$ is less than $\frac1{2^{n-1}}$, and hence by the Borel Cantelli Lemma, $E = \liminf E_n$ has full measure in $[0,1]$.
We will show that $f'(x) = 0$ for $x \in E$. Suppose that $x \in E$, that is, for some $n_0 \ge 0$, we have $x \in \bigcap_{m \ge n_0} E_m$. Suppose that $|x - y| < 2^{-2n}$ for $n \ge n_0$. Then there exists an $m \ge n$ such that $2^{-2m-2} \le |x-y| < 2^{-2m}$. Since $x \in E_m$, we have that $f_l(x) = f_l(y)$ for $l \le m$. Then
\begin{align} |g(x) - g(y) |
&\le \sum_{l \ge m} 2^{-2l} |f_l(x) - f_l(y)|
\\& \le \sum_{l \ge m} 2^{-2l}(|x-y| + 2^{-l})
\\& \le 2^{-2m} | x-y | + 2^{-3m}
\\ &\le 5 \times2^{-m} |x-y|
\\ &\le 5 \times2^{-n} |x-y|
.\end{align}
To make it discontinuous at the rationals, use $n!$ instead of $2^n$. However, I don't see how to make it differentiable at all the irrationals, only on a set of full measure.
Best Answer
The best way to ask such questions is the most general.
Not surprising is that there is an exact answer to this. The NASC on $D$ is that it be the intersection of a set $A$ of type $\cal F_\sigma$ and a set $B$ of type $\cal F_{\sigma\delta}$ with the Lebesgue measure of $B$ equal to $b-a$.
If you ask instead for a continuous function of bounded variation then you can drop $A$ (remembering that the set $D$ for such functions must be of full measure).
In particular, pick your favorite $\cal F_\sigma$ set and there must a continuous function differentiable precisely at the points of that set. Expressed differently, pick your least favorite $\cal G_\delta$ set and there is a continuous function which fails to be differentiable on exactly that set. The Cantor set is evidently allowed here, and (besides) that is the easiest example to give anyway.
See Chapter 14, Section 3. The set of points of differentiability of a function in this monograph for a discussion:
https://www.amazon.com/Differentiation-Real-Functions-Crm-Monograph/dp/0821869906
More details are available in this Monthly survey:
which is downloadable from here: https://www.jstor.org/stable/2313749
or here: http://classicalrealanalysis.info/documents/andy1966.pdf