Find $f(1729)$ if $n^2\int_{x}^{x+\frac 1 n} f(t)\;\text{d}t=nf(x)+0.5$ I was asked this question-

Let $f$ be a real continuous function satisfying $f(0)=0$ and for each natural number $n$
$$n^2\int_{x}^{x+\frac 1 n} f(t)\;\text{d}t=nf(x)+0.5$$
Then find the value of $f(1729)$

I couldn't make much of a progress. But I tried using
$$F(x)=\int_0^x f(x)\;\text{d}x$$
so that
$$\int_{x}^{x+\frac 1 n} f(t)\;\text{d}t=F\left(x+\frac 1 n\right)-F(x)$$
and then maybe letting $n$ go to infinity such that we can think about the behaviour of
$$\lim_{n\to \infty} n^2\cdot \left(F\left(x+\frac 1 n\right)-F(x)\right)$$
But, soon I realised that we don't even know whether this limit exists, since we don't have any idea of whether the limit in the RHS exists, i.e., we don't know whether
$$\lim_{n\to \infty} nf(x)$$
exists. However, if this would somehow exist, we could have argued that the limit of the LHS also exists, and thus,
$$\left(F\left(x+\frac 1 n\right)-F(x)\right)=\frac {h(x)}{n^2}$$
But still, there's no progress.
Another approach that I tried was to sum up the equation from $1$ to $k$ to get
$$\sum_{n=1}^k n^2\int_{x}^{x+\frac 1 n} f(t)\;\text{d}t = \frac {k(k+1)}2 f(x) + \frac k 2$$
But how to calculate the sum on the LHS? I tried writing it as
$$\sum_{n=1}^k n^2\cdot \left(F\left(x+\frac 1 n\right)-F(x)\right)=\sum_{n=1}^k n^2\cdot F\left(x+\frac 1 n\right) - \sum_{n=1}^k n^2\cdot F(x)$$
where the second term maybe easy to calculate, but what about the first term?
Any help would be appreciated. Also, I'm not really sure about the tags- feel free to edit them.
 A: Let
\begin{equation}
F(x)= \int_0^x f(t) \mathrm{d}t.
\end{equation}
We may rewrite the equation as
\begin{equation}
n^2\left(F\left(x+\frac1n\right)- F(x)\right)= nf(x)+ 0.5.
\end{equation}
Since the left-hand side is continuously differentiable, so is the right hand. As a result, we deduce that $f$ is smooth, thus so is $F$. Now, by Taylor expansion we have
\begin{equation}
F\left(x+\frac1n\right)= F(x)+ \frac1n F'(x)+ \frac{1}{2n^2}F''(x)+ O\left(\frac{1}{n^3}\right),
\end{equation}
i.e.,
\begin{equation}
0.5= n^2\left(F\left(x+\frac1n\right)- F(x)\right)-nf(x)= \frac12 F''(x)+ n^2 O\left(\frac{1}{n^3}\right).
\end{equation}
Taking $n\to\infty$ we get
\begin{equation}
F''(x)=1,
\end{equation}
or equivalently, $f'(x)=1$, for all $x$. This, together with the initial condition $f(0)=0$ implies that
\begin{equation}
f(x)=x.
\end{equation}
As a result, $f(1729)= 1729$.
A: Note that the given condition can be written as
$$\frac{F(x+1/n) - F(x)}{1/n} = f(x) + \frac{1}{2n}$$
Now differentiate both sides to get
$$\frac{f(x+1/n) - f(x)}{(\color{red}{x+}1/n) \color{red}{-x} } = f'(x)$$
by mean value theorem, there exists $\xi_{n,x} \in (x, x+1/n)$ such that
$$f'(\xi_{n,x}) = f'(x)$$
Hence, by Rolle's theorem, there exists $\eta_{n,x} \in (\xi_{n,x}, x)$ such that
$$f''(\eta_{n,x}) = 0$$
Since $\xi_{n,x}$ squeezes $\eta_{n,x}$ to $x$ as $n\to\infty$, we have $\eta_{n,x} \xrightarrow{n\to\infty} x$. It follows that $$0 = \lim_{n\to\infty}f''(\eta_{n,x}) = f''(x)$$
for all $x$. Hence, $f(x)$ is a linear function.
Now, let $f(x) = ax + b$ and finish it.
A: Plugging in $0$ on both sides, we obtain
$$n^2\int_0^{\frac{1}{n}} f(t) dt = nf(0)+\frac{1}{2} \implies \int_0^{\frac{1}{n}} f(t)dt = \frac{1}{2n^2}$$
which means $f(t)=t$ and $f(1729)=1729$
