What exactly does the differential of a function mean? One of the first concepts that any calculus student learns is that the differential essentially measures the instantaneous rate of change of a curve/ the slope at any point, and this makes sense of continuous curves like $x^2$, $sin(x)$, etc. But what would that mean for a  function that's differentiable and continuous at only one point, like $x^2q(x)$ where $q(x)$ is the indicator function of rationals?
I have glanced through the answers to this question
but it seems to be more concerned with continuous functions that functions that are continuous and differentiable at only one point.
reference:-
https://math.stackexchange.com/a/4580221/879009
and
Can a function be differentiable at only isolated points?.
 A: I would like to challenge the question. If the derivative makes sense at the point, then there is a reasonable approximation for the function by a linear function at the point. What's the issue? Your function $y = x^2q(x)$ is only continuous at $0$ even, but it's derivative exists there and is $0$, reflecting the fact that close to $0$, all points are very close to $0$. So $L(x) = 0$ is a good approximation by linear functions in a small neighborhood of $0$.
A: One very purist answer is that it is just an abstract definition with no inherent meaning.  However, it is frequently useful in the real world.  Why mathematics is so often very effective at modelling the real world has been debated.  See The Unreasonable Effectiveness of Mathematics in the Natural Sciences.
I guess that you have seen proofs of theorems such as the Intermediate value theorem.  Some students react with "that's obvious, why do we need to prove it?".  This can be turned around as a test that the formal definition of continuity matches our intuitive concept.
The way I see these odd functions is that our formal definitions have gone a bit beyond the requirements of modelling the real world.  Consider that you buy a tool for a certain task, are you upset that it does some tasks beyond its principal task?
If you want to see an even more weird function, look at the Weierstrass function
