Write:
$$y=x^x=e^{x\log x}$$
If we want $y \in \mathbb{R}$ we must have $\log x \in \mathbb{R}$ and this is done only if $x> 0$
This is the usual definition for the function $y=f(x)=x^x$ for $x \in \mathbb{R}$, that gives $(0,+\infty)$ as the domain.
If we want $x\in \mathbb{Q}$ than we can define the function as:
$$
y=f(x)=x^x=\left( \frac{m}{n}\right)^{\frac{m}{n}} \iff y=\sqrt[n]{x^m} \iff y^n=\left(\frac{m}{n}\right)^m
$$
If we define $0^0=1$, this is a real number if $n=2k+1 \quad \forall k\in \mathbb{Z}$ so the domain of the function can be:
$$
\{q\in \mathbb{Q}|q=\frac{m}{2k+1}\quad , \quad m,k \in \mathbb{Z} \}
$$