Evaluate $ \int_{0}^{1} [mx] \, dx$ 
Evaluate
  $$  \int_{0}^{1} [mx] \, dx$$

The problem is like this: Consider the following function: $f:[0,1]\rightarrow R$, with $m>0 $, where $[ x ]$ is the floor function. Determine $m$ for which
$$ \int_{0}^{1} f(x)=\frac{3}{2}. $$
My attempt was to start from: $m x-1<[m x]\le m x$ and then to split the main integral into two. I am not sure if this the way to go. 
Any help is appreciated.  
 A: Yes, you have the right idea. The total integral will be a sum of integrals of step functions between each integral section. In general, if $m$ is a positive integer, you will get
$$\begin{equation}\begin{aligned}
\int_{0}^{1}\lfloor mx\rfloor dx & = \sum_{i=0}^{m-1}\left(\int_{\frac{i}{m}}^{\frac{i+1}{m}}idx\right) \\
& = \sum_{i=0}^{m-1}\left(\left. ix\right\rvert_{\frac{i}{m}}^{\frac{i+1}{m}}\right) \\
& = \sum_{i=0}^{m-1}\left(\frac{i}{m}\right) \\
& = \frac{(m-1)(m)}{2m} \\
& = \frac{m-1}{2}
\end{aligned}\end{equation}\tag{1}\label{eq1A}$$
In your case, for the sum to be equal to $\frac{3}{2}$ means that $m = 4$. You can also confirm a relatively small case like this manually yourself.
Note that if $m$ is not an integer, the formula above will need to be adjusted to handle the last small section, but fortunately this is not needed here.
Update:
To handle the more general case where $m$ may not be an integer, you would need to use the integral part (i.e., use the floor function) of $m$ in the limits instead plus, as stated above, an additional term to handle the last fractional part. You would thus get
$$\begin{equation}\begin{aligned}
\int_{0}^{1}\lfloor mx\rfloor dx & = \sum_{i=0}^{\lfloor m\rfloor - 1}\left(\int_{\frac{i}{m}}^{\frac{i+1}{m}}idx\right) + \int_{\lfloor m\rfloor}^{m}(1)dx \\
& = \sum_{i=0}^{\lfloor m\rfloor - 1}\left(\left. ix\right\rvert_{\frac{i}{m}}^{\frac{i+1}{m}}\right) + \left. x\right\rvert_{\lfloor m\rfloor}^{m} \\
& = \sum_{i=0}^{\lfloor m\rfloor - 1}\left(\frac{i}{m}\right) + (m - \lfloor m\rfloor) \\
& = \frac{(\lfloor m\rfloor- 1 )(\lfloor m\rfloor)}{2m} + (m - \lfloor m\rfloor)
\end{aligned}\end{equation}\tag{2}\label{eq2A}$$
In the case where $m$ is an integer, the second term is $0$ and the first term becomes the same as the result in \eqref{eq1A}.
A: First, note if $m\leq 1$, then the integral is 0. So I'll assume $m>1$.
Using a substitution, we have
$$
\int _0^1 [mx]\,dx = \frac{1}{m}\int_0^m [y]\,dy
$$
$$
= \frac{1}{m}\int_0^{[m]} [y]\,dy+\frac{1}{m}\int_{[m]}^{m} [y]\,dy
$$The first integral can be evaluated by a simple sum, while on the second integral $[y]=[m]$. So we have
$$
\int _0^1 [mx]\,dx = \frac{[m]-1}{2}+ \frac{[m] (m-[m])}{m}
$$Note the second term vanishes at integer $m$. In particular, $m=4$ gives the value of $3/2$.
