Let $f : K \to \mathbb{R}$ be a continuous function for some open cube $K \subset \mathbb{R}^n$ with edges parallel to the coordinate axes. Suppose that $f \vert_{K \cap L}$ is of bounded variation for every line $L$ that is parallel to a coordiante axis. Is it true that $f$ has bounded variation on $K$?
This isn't a set exercise; I don't know if it's true or not.