How can we prove that $$\left\lfloor x\right\rfloor + \left\lfloor x + \frac{1}{n} \right\rfloor + \left\lfloor x + \frac{2}{n} \right\rfloor + \cdots + \left \lfloor x + \frac{(n-1)}{n} \right\rfloor = \left\lfloor nx \right \rfloor$$ Where $\lfloor x\rfloor$ denotes greatest integer less than or equal to $x$. I was able to prove it when $n = 2$ or $3$. Please see this link.
But I can't prove it generally. I tried it using Principle of mathematical Induction but couldn't. Can someone prove it using some other way using properties of greatest integer function?
Denoting the left hand side with $f(x)$, the right hand side with $g(x)$, show that $f(x+\frac1n)=f(x)+1$ and $g(x+\frac1n)=g(x)+1$. Also show $f(x)=0=g(x)$ for $0\le x<\frac 1n$. Then show by backward and forward induction on $k\in \Bbb Z$ that $f(x)=g(x)$ for all $x$ with $\frac kn\le x<\frac{k+1}n$.
Alternatively, write $x=k+y$ with $k=[x]\in\Bbb Z$ and $y\in[0,1)$, then write $ny=m+z$ with $m=[ny]\in\{0,1,\ldots,n-1\}$ and $z\in[0,1)$ and see what happens if you plug in $x=k+\frac1n m+\frac1nz$.