According to some material I was reading, it says that a function $f$ with domain in an interval $I$ is a solution of a differential equation in the interval $I$ if $f$ satisfies that differential equation in the interval I. For instance, does it mean that $y=ax^n$, where $n>1$ is an integer and $a\neq0$ is a constant, is a solution for the differential equation $\frac{dy}{dx}=0$ in the interval of $x=0$? I found this answer and I suspect it may be related to my question. https://math.stackexchange.com/a/2311041/1174565
Regarding the answer in the link, I was thinking that it seems like $I$ in this case doesn't meet the conditions (I think $I$ is connected, but not open and degenerate instead, which in turns makes the function non-differentiable because it just goes from $x=0$ to $y=0$ and is not defined for any other values), thus saying $y=ax^n$ is a solution for the ODE in $I$ is vacuously true.
I would appreciate it if you let me know any misconception I may have regarding this issue and the definitions.
Yes, that's a degenerate interval if you consider it an interval at all. In the context of differential equations, and really anywhere involving derivatives, we want to think about open intervals, since the derivative is all about the behavior of a function in a neighborhood of a given point. We have to have some amount of definition on either side of the given point in order to have a derivative.
As soon as we require the ODE to hold on an open neighborhood, then $y = ax^n$ with $a \neq 0$ no longer satisfies $\frac{dy}{dx} = 0$ away from the point $x=0$.