Reference:(Fubini's Theorem)
Question:
Is there any example for $f: I\to \mathbb{R}^n$ both the iterated integrals in Fubini's theorem exists and are equal, yet $f \not \in R(I)$ ?
Edit:
Both question and the theorem comes from the second edition of the book Mathematical Anaylsis II by Zorich.
Edit 2:
That famous Remark that I always mentioned.



Answer to the question below. First we should note that the theorem as stated is false, if we're talking about Riemann integrals.
Let $X=Y=[0,1]$. Let $f(x,y)=0$ if $y\ne0$; let $f(x,0)=1$ if $x$ is rational, $0$ otherwise. It's easy to see from the definition that $f$ is Riemann integrable on $X\times Y$ (or note that $f$ is certainly continuous almost everywhere.) But $\int_0^1 f(x,0)\,dx$ does not exist, hence at least one of the iterated integrals fails to exist.
Fubini's theorem would be one reason they invented the Lebesgue integral... It turns out that that little detail, a function has to be defined on $X$ before it can be Riemann integrable on $X$, is the only problem:
Proof, in questionable taste: For a given $x$, if $f$ is continuous at $(x,y)$ for almost every $y$ then DCT shows that $g$ is continuous at $x$. So the measure-theory Fubini's theorem shows that $g$ is continuous almost everywhere, hence Riemann integrable. The measure-theory Fubini theorem shows that $\int_X g(x)\,dx=\int_{X\times Y}f(x,y)\,dxdy$.
Digression
The OP has been insisting that changing a function on a set of measure zero does not change the Riemann integral. This is well known to be nonsense. For the benefit of anyone who doesn't see why it's nonsense:
Define $z:[0,1]\to\Bbb R$ by $z(t)=0$. Then $\int_0^1 z(t)\,dt=0$. Now modify $z$ on a set of measure zero: Define $r(t)=0$ if $t$ is irrational, $1$ if $t$ is rational. Then $r$ is not Riemann integrable.
It's obvious for example that every "upper sum" for $r$ equals $1$ while every lower sum equals $0$.
An explanation using just Riemann sums, showing that modifying a function on a set of measure zero does change the limiting behavior of the Riemann sums: If $n$ is even let $$s_n=\frac1n\sum_{j=1}^nr(j/n)$$. If $n$ is odd choose an irrational number $\alpha_n$ with $0<\alpha_n<1/n$, and let $$s_n=\frac1n\sum_{j=1}^nr(j/n-\alpha_n).$$
Then $(s_n)$ is a sequence of Riemann sums for $r$, corresponding to a sequence of partitions with mesh tending to $0$. But $s_n=1$ if $n$ is even and $s_n=0$ if $n$ is odd. So $\lim s_n$ does not exist. So by definition $r$ is not Riemannn integrable.
(It's true, and not hard to show, that modifying a function on a compact set of measure zero does not change the Riemann integral. That doesn't help rehabilitate the theorem, because if $f$ is Riemann integrable on $[0,1]\times[0,1]$ the null set of $x$ where $\int_0^1f(x,y)\,dy$ does not exist need not be compact.)
Example showing the the set of $x$ such that $\int_0^1f(x,y)\,dy$ does not exist need not be compact: Say $(q_j)$ is a countable dense subset of $[0,1]$. Define $f(x,y)=0$ if $x\notin(q_j)$, and set $f(q_j,y)=0$ if $y$ is irrational, $1/j$ if $y$ is rational. Then $f$ is Riemann integrable on $[0,1]\times[0,1]$, but for every $j$ the integral $\int_0^1f(q_j,y)\,dy$ fails to exist.
End digression
Below Assuming you mean $I=[0,1]\times[0,1]$: Let $S=(p_j)$ be a countable dense subset of $I$ such that $S$ intersects each vertical line and each horizontal line in at most one point. (Construction below.) Let $f(p_j)=1$, $f(x,y)=0$ for $(x,y)\notin S$. Then both iterated (Riemann) integrals exist, but $f$ is not Riemann integrable on $I$; for example $f$ is not continuous at any point.
Construction: Say $(q_j)$ is a countable dense set. Let $p_1=q_1$. Choose $p_2$ so $|p_2-q_2|<1/2$ and $p_2$ does not have either coordinate in common with $p_1$. Etc: One by one choose $p_n$ so $|q_n-p_n|<1/n$ and the $x$ and $y$ coordinates of $p_n$ are different from the coordinates of $p_j$, $1\le j<n$.