A non-Riemann-integrable function $f\colon [0, 1]^2 \to \mathbb{R}$ such that $f(\cdot, y), f(x, \cdot)$ are Riemann integrable. I need to find a bounded $f\colon [0, 1]^2 \to \mathbb{R}$  which is not Riemann integrable, but such that $f(\cdot, y), f(x,\cdot)$ are Riemman integrable as functions from $[0, 1]$ to $\mathbb{R}$ for every fixed $x,y$.
I've tried several tricks that didn't work out. I began suspecting that there is no such example but I also couldn't prove it.
Any ideas?
 A: Let me expand my comment into an answer.
As user71352 comments above, you can use the characteristic function of a set $A\subset [0,1]^2$ which is dense but each horizontal and vertical line contains at most one point of $A$.
You indicated in a comment that you know how to construct such a set, so I will postpone it to the end of this answer.
The set $A$ is not Jordan measurable, so its characteristic function is not Riemann integrable.
This is closely analogous to proving that the characteristic function of rational numbers on $[0,1]$ is not Riemann integrable.
For this argument it is enough to know that both $A$ and its complement are dense in $[0,1]^2$ — this is sufficient but not necessary for the characteristic function $\chi_A$ being non-integrable.
On the other hand, the characteristic function of a singleton or an empty set on $[0,1]$ is clearly Riemann integrable and the integral is zero.
Therefore $\chi_A$ is a suitable function.
If you want to use a characteristic function as an example (which is often a good idea to consider), it is crucial that the set is not Jordan measurable.
Otherwise the integral over $[0,1]^2$ would exist.
If you take this path, you need a non-measurable set whose horizontal and vertical slices are all measurable.
This is just to argue that the line of reasoning presented here is very natural.

Constructing the set $A$
Here is one way to build a set $A$ which is dense but so that each horizontal and vertical slice contains at most one point.
It is not an explicit set, but the construction is fairly simple.
The first thing we need is a countable collection of open sets $U_1,U_2,\dots\subset[0,1]^2$ so that for any $x\in[0,1]^2$ and $r>0$ there is an index $i$ so that $U_i\subset B(x,r)$.
Here some options:

*

*Observe abstractly that the square is a separable metric space and therefore its topology has a countable basis. This basis is suitable for our purposes.

*Take all balls $B(x,r)$ where $x$ has rational coordinates and $r\in\mathbb Q$.

*Take all open squares $(a,b)\times(c,d)$ with $a,b,c,d\in\mathbb Q$.

Construct a sequence $x_1,x_2,\dots$ inductively as follows.
First take any point $x_1\in U_1$.
For $i>1$, take a point $x_i\in U_i$ so that $x_i$ does not share either coordinate with any of the points $x_1,\dots,x_{i-1}$.
Since the set $U_i$ is open, avoiding these (finitely many) coordinates can be done.
Now take $A=\{x_1,x_2,\dots\}$.
This set satisfies the slice property by construction; the points $x_i$ and $x_j$, $i<j$, cannot share a coordinate.
(This set is countable, so its complement is clearly dense. This follows from the slice property, too.)
This set is dense; for any $x\in[0,1]^2$ and $r>0$ there is $x_i\in U_i\subset B(x,r)$.
