$f(x) = \sin x $, if $x$ is rational and $f(x) = x$, if $x$ is irrational. A function $f$ is defined on $[0,\pi/2]$ by 
$$f(x) = 
\begin{cases}
\sin x, & x\ \text{is rational},\\
x, & x\ \text{is irrational}
\end{cases}$$
Then to find the upper integral and the lower integral and hence to show that the function is not integrable on $[0, \pi/2]$.
I am finding a difficulty to choose a partition such that computing the upper and lower sum will be easier.
 A: Here's what I would do: I would generalise the problem. The real tension in this problem is that the function imitates one function on a dense set and a completely different function on another dense set. So, I'm thinking we want to prove the following:

Suppose $f$ and $g$ are Riemann integrable on an interval $I$, and $f(x) = g(x)$ for all $x \in D \subseteq I$, where $D$ is dense in $I$. Then $\int_I f = \int_I g$.

We could use this to prove the function above is not Riemann integrable, since the above function equals both $x$ and $\sin(x)$ on dense subsets of $[0, \pi/2]$, so if $f$ were integrable, its integral should equal the definite integrals of both $x$ and $\sin(x)$, which is impossible since the integrals aren't equal. However, to actually prove this true, it's easier to use the algebra of integrals to prove an equivalent, seemingly weaker proposition:

Suppose $f$ is Riemann integrable on an interval $I$ and $f(x) = 0$ for all $x \in D \subseteq I$ where $D$ is dense in $I$. Then $\int_I f = 0$.

Before we prove the above proposition, recall the definition of Riemann integrability of $f$: that $U(f) = L(f)$. Recall further that $U(f)$ is the infimum of $U(f, P)$ over all partitions $P$ of the interval, where $U(f, P)$ is the upper sum of $f$ over $P$. Similarly, $L(f)$ is the supremum of $L(f, P)$ over partitions $P$, where $L(f, P)$ is the lower sum of $f$ over $P$. We define $\int_I f := U(f) = L(f)$.
Now, proving the proposition is simple. Consider any partition $P$ of $I$. In any part of $P$, there must contain an element of $D$, since $D$ is dense in $I$ and each part has a non-empty interior. So, in each part, there is a point that the function $f$ maps to $0$. Therefore, the supremum of $f$ over each part in $P$ must be at least $0$, proving $U(f, P) \ge 0$ for all $P$. Similarly $L(f, P) \le 0$ for all $P$. Taking infima and suprema respectively yields
$$0 \ge L(f) = U(f) \ge 0 \implies \int_I f = 0.$$
QED
