In Physics (both in Statistical & Quantum Mechanics) when we describe the probability function of finding a particle between $x$ and $x+dx$, we write $\int_{x}^{x+dx} p(x) \,dx = P(x)$.
Here in some books the interval is chosen as $(x,x+dx)$ and in some other books it's chosen as $[x,x+dx]$. Depending on the chosen interval, the writing will either say: “between $x$ and $x+dx$“ or “from $x$ to $x+dx$“, respectively.
Though the probability in finding a particle at the endpoints $x$, $x+dx$ is zero, so it's not necessary to include or exclude the boundary points, as the integral will give the same result, but for the Physics and Physical arguments, which one is correct and why?
Edit:
My understanding (I may be wrong): if we consider a spherical shell at a distance $x$ from the origin with width $dx$, then the particle would be in a small shell of $dx$ from the distance $x$. My question is if we define the open interval and closed interval in the probability definition, then we are respectively excluding and including the fact that the particle may not or may access the position $x$ and $x+dx$ respectively. Both can't be correct according to my understanding. So, which one should be correct and why?
There are already answers from the "physical" viewpoint. Let me throw in some mathematics, too, which is honestly the juice of a physical theory:
In Quantum Mechanics, the integral defining a probability function is made with respect to the Lebesgue Measure. A neat thing about the Lebesgue Measure $\mu_L$ on $\mathbb{R}$ is that:
$$\mu_L (\left(a,b\right)) = \mu_{L} (\left[a,b\right]) = b-a, ~ \forall~ -\infty<a<b<+\infty$$ $$ \mu_L (\{a\}) = \mu_L (\{b\}) = 0$$
As such, a probability measure on $\mathbb{R}$ is defined according to whichever interval you want, the result will be the same. This is only because the points on the real axis (in particular the two endpoints of the interval) are Lebesgue-measure $0$.
Why is Lebesgue integrability relevant?
Wavefunctions or probability densities are required to be Lebesgue integrable and not required to be continuous or Riemann integrable. This is of utmost importance since at an abstract level it allows both the completion of the pre-Hilbert space $\mathscr{L}^2(\Omega\subseteq\mathbb{R}^3,d\mu)$ with respect to the norm induced by the scalar product, and the von Neumann's theory of self-adjoint extensions of symmetric operators which is the basis of all the mathematical (standard, i.e. Hilbert space) framework of states and observables (to be more precise, the domains of self-adjointness of operators contain functions which are not continuous on subsets of $0$-Lebesgue measure. This forces us to define the Schrödinger equation not in the strong sense, but in a weak sense).