I am trying to show that the median is a M-estimator, and the definition is $t$ is an M-estimator if there exist a function $\psi$ such that $$ t=\arg\min_s\mathbb{E}(\psi(s,X))\qquad(1)$$ so for empirical median it is known that $\psi(s,X)=|X-s|$ and $\mathbb{E}$ is the empirical mean, but I do not understand why $$t=median(X_1,...,X_n)$$ is solution of the equation (1).
Any help, hint, or observation is welcome. Thank you!.