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)$ 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.


 A: 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:


Theorem: Suppose $f$ is Riemann integrable on $X\times Y$ as above. If $g(x)=\int_Yf(x,y)\,dy$ exists for every $x\in X$ then $g$ is Riemann  integrable and $\int_X g(x)\,dx=\int_{X\times Y}f(x,y)\,dxdy$.


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$.
A: The statement of the Theorem given as a reference is false. As such, it is just a distraction with respect to the Question, which David C. Ullrich has answered by providing a nice example. 
I just will focus on the theorem to help clarify beyond what has already been discussed in the comments.
The hypothesis is that the bounded function $f:X \times Y \to \mathbb{R}$ is Riemann integrable on the bounded interval (rectangle) $X \times Y \subset \mathbb{R}^{n+m}.$ What is a true statement is that 
$$\tag{1}\int_{X \times Y} f = \int_X \left(\underline{\int}_Y f(x,y) \, dy\right) dx = \int_X \underline{J}(x) \, dx \\ =  \int_X \left(\overline{\int}_Y f(x,y) \, dy\right)   \, dx = \int_X \overline{J}(x)\, dx, $$
where for fixed $x\in X$ the lower and upper Darboux integrals appearing above must exist (since $f$ is bounded) and as a conclusion are themselves Riemann integrable over $X$ and satisfy (1).
We also have a similar statement as (1) with the order of the integration reversed, but we don't need to discuss that to proceed.
Proof of (1)
Let $P = P_X \times P_Y$ be partition of $X \times Y$ where $P_X$ and $P_Y$ are partions of $X$ and $Y$ into subintervals in $\mathbb{R}^m$ and $\mathbb{R}^n$, respectively.  On any subinterval $R_X \times R_Y$ of $P$ we have $m_{R_X \times R_Y}(f) = \inf_{R_X \times R_Y} f(x,y) \leqslant f(x,y)$ and $m_{R_X \times R_Y}(f) \leqslant \inf_{R_Y} f(x,y) = m_{R_Y}(f)$, where we take $x$ as fixed in the second inequality.
Hence,
$$\sum_{R_Y} m_{R_X \times R_Y}(f) \text{vol }(R_Y) \\ \leqslant \sum_{R_Y} m_{R_Y}(f) \text{vol }(R_Y) = L(P_Y, f(x,\cdot))  \leqslant \underline{\int}_Y f(x,y) \, dy  = \underline{J}(x)$$
Taking the infimum over $x \in R_X$, multiplying by $\text{vol }(R_X)$, and summing we get for lower Darboux sums
$$L(P,f) = \sum_{R_X, R_Y} m_{R_X \times R_Y}(f) \text{vol }(R_Y)\text{vol }(R_X)  \leqslant  \sum_{R_X} \inf_{R_X} \underline{J}(x) \text{vol }(R_X) = L(P_X, \underline{J}) $$
Similarly we can show for upper Darboux sums that $U(P,f) \geqslant U(P_X, \overline{J}),$ and it follows that
$$L(P,f) \leqslant L(P_X, \underline{J}) \leqslant U(P_X,\underline{J}) \leqslant U(P_X,\overline{J}) \leqslant U(P,f), \\ L(P,f) \leqslant L(P_X, \underline{J}) \leqslant L(P_X,\overline{J}) \leqslant U(P_X,\overline{J}) \leqslant U(P,f). $$
Since $f$ is Riemann integrable, for any $\epsilon > 0$ there is a partition $P$ such that
$$U(P,f) - L(P,f) < \epsilon, \,\, U(P_X,\underline{J}) - L(P_X,\underline{J}) < \epsilon, \, \, U(P_X,\overline{J}) - L(P_X,\overline{J}) < \epsilon,$$
and it follows that $\underline{J}$ and $\overline{J}$ are integrable over $X$ and (1) holds.
Correction of the Theorem (Zorich)
Since $\int_X \overline{J}(x) \, dx = \int_X \underline{J}(x) \, dx $ and $\overline{J}(x) \geqslant \underline{J}(x)$, it follows that $\overline{J}(x) = \underline{J}(x)$ almost everywhere, and the Riemann integral
$$\int_Y f(x,y) \, dy$$
exists except perhaps for $x$ in a set of measure zero where $\underline{J}(x) < \overline{J}(x)$ with strict inequality.
As pointed out by David C. Ulrich, that does not mean that a value may be assigned arbitrarily to the "symbol" $\int_Y f(x,y) \, dy$ and the Theorem holds. What Zorich should have stated is let the function $F:X \to \mathbb{R}$ be defined as 
$$F(x) = \int_Y f(x,y) \, dy$$
when that integral exists, and let it be defined as any value in the interval
$[\underline{J}(x), \overline{J}(x)]$ when $\underline{J}(x) <  \overline{J}(x)$ and the integral does not exist.  Then instead of (1) the correct statement is 
$$\tag{2} \int_{X \times Y} f = \int_X F(x) \, dx,$$
with something similar when the order of integration is reversed.
