Call a set $S$ convex if whenever $x,y\in S$, then $tx+(1-t)y\in S$ for any $t\in[0,1]$. Suppose that $S$ is an open convex set in $\mathbb R^n$ and suppose that $f:\mathbb R^n\to\mathbb R$. If $f'(x;y)=0$ for any $x\in S$ and any $y\in\mathbb R^n$ then show that $f$ is constant on $S$.
This is a problem from Apostol Calculus Vol. 2. I observed that a similar question has been asked before on this site but the answer provided there was misled by a confusion regarding the notation $f'(x;y)$. To dispel any perplexity, and strictly following Apostol's notation, define, for a scalar field $f:\mathbb R^n\to\mathbb R$, $$f'(x;y)=\lim_{h\to0}\dfrac{f(x+hy)-f(x)}{h}$$ where $y\in\mathbb R^n$.
I would like the community to grade my solution as correct or incorrect or if improvements are suggested:
First of all, we note that an open convex set cannot be finite. Hence, take any $x\in S$, and then take any $y$ such that $x+y\in S$. (we can do these since $S$ is not finite).Then, applying the Mean Value Theorem, $$f(x+y)-f(x)=f'(x+\theta y;y)$$for some $\theta\in(0,1)$. Since $x\in S, x+y\in S$, we must have that $x+\theta y\in S$ as $S$ is convex. So, $f'(x+\theta y;y)=0$.
Hence we have for any $x\in S$ and any $y$ such that $x+y\in S$, $$f(x+y)=f(x)$$. Note that the RHS is independent of $y$, so the equation must be independent of $y$. Select $y=c-x$ where $c\in S$, $c$ is fixed. Then we have, for all $x\in S$, $$f(x)=f(c)$$which shows the constancy of $f$ on $S$.