Concept:
The function is defined as
\[
f(x)=
\begin{cases}
1, & x\in Q,\\
-1, & x\in R-Q.
\end{cases}
\]
This is a modified Dirichlet-type function.
Both rational and irrational numbers are dense in every interval.
Step 1: Check boundedness.
The function takes only two values:
\[
1
\]
and
\[
-1
\]
So it is bounded on every interval.
Step 2: Find supremum and infimum on any subinterval.
In every subinterval of \([a,b]\), there are rational numbers and irrational numbers.
Therefore, on every subinterval,
\[
\sup f=1
\]
and
\[
\inf f=-1
\]
Step 3: Lower and upper sums.
The lower sums are based on infimum, so they involve \(-1\).
The upper sums are based on supremum, so they involve \(1\).
Thus the lower and upper Riemann integrals exist, but they are not equal.
Step 4: Final conclusion.
Since lower and upper integrals are not equal, the function is not Riemann integrable.
\[
\boxed{\text{Lower and upper Riemann integrals exist but are not equal}}
\]