Why do we take only intervals for solution of differential equation Suppose the solution to my equation blows up at 0 and is well defined everywhere else. Then why can't we just take R-{0} as the domain of the function? Also can someone give an example of a nonzero function whose first order derivative is zero?
Edit: sorry, nonzero function which is not constant.
 Suppose the solution to a differential equation is  1/x then why do we have to take an interval and not R-{0}
 A: Suppose your equation is 
$$
y'(x)=-\frac 1{x^2}\\
y(1)=1
$$
just to keep it simple. Then clearly, for positive $x$, the solution is $\frac1x$. However, the equation itself says nothing about what the value of the function is for negative numbers. Maybe for negative $x$ we have $y=\frac1x +1000$? There is just no way to use the equation to extend a solution uniquely past a point of singularity like that.
As for a function with a zero derivative, such a function must be constant on any connected component of its domain. Maybe that can give you some hint on how to find one.
A: In full generality, you can look at solutions on any open set $U$, and the theory will work just fine. In particular: given a differential equation $E$, you get a corresponding sheaf $\tilde{E}$ by defining $\tilde{E}(U)$ to be the set of all solutions to the equation on the open set $U$.
However, the benefit of restricting attention to situations where $U$ is connected is that it ensures uniqueness of solutions to IVPs.
For example, if we know that $\frac{dy}{dx} = 1/x$ and that $y(x := 1) = 0$, then we can conclude that $y = \mathrm{log}_e(x)$, but only if we're implicitly working on an open set $U$ that contains $1$, does not contain $0$, and happens to be connected. Note that $(0,\infty)$ is the largest such set. If we included some extra points in our set, say $U = (-\infty,0) \cup (0,\infty)$, then our IVP would have more than one solution. In particular, for all $A \in \mathbb{R}$, the function
$$y = \begin{cases} \mathrm{log}_e(-x)+A, x < 0 \\ \mathrm{log}_w(x), x > 0 \end{cases}$$
solves the aforementioned IVP on the domain $U = (-\infty,0) \cup (0,\infty).$
