Shannon interpolation formula for downsampled data with an "almost ideal" low pass filter
I don't get your downsample step when you downsampled by factor $M$.

Let me go from scratch with the spectrum visualization below, with time domain, continuous frequency domain and discrete frequency domain from left to right.



When we reduce the sampling frequency by a factor $k$, the signal spectrum is copied to new replicas at $f_s/k$. The discrete spectrum is a snapshot of continuos spectrum at $[-f_s, f_s]$ and $[-f_{s,down} = f_s/k, f_{s,down} = f_s/k]$, so it is expanded by the factor $k$.

The DFT works on the discrete frequency domain. The downsample $k$ must be chosen so that the expanded spectrum (in discrete frequency, or the new replicas in continuous version) does not overlap with their copies centered at $-2\pi$ and $2\pi$, or $-1/2$ and $1/2$ if you take discrete instantenous frequency by dividing $2\pi$; otherwise aliasing happens and the reconstruction of $x(t)$ is impossible. If there is not alias, a low pass filter to take the spectrum part centered at 0 is suffice. This filter does not need to be "ideal", just to be sure that the filter takes only the center part.

In your calculation, if I understand well, you are talking about the discrete frequency domain and the original spectrum takes $1/M$ the normalized band (you said $f$ is in $[-1/2, 1/2]$ and your signal has support in $[-1/2M, 1/2M]$). In this case your downsample factor $k$ must be less than $M/2$ and the cutoff frequency of your ideal filter must be at $1/4$ if $k=M/2$ (and yes, in this case $k=M/2$, we need "ideal filter" assumption).