Let $X\sim f(x)=\begin{cases}\lambda e^{-\lambda x},&x\in [0,5)\\e^{-5\lambda},&x=5\end{cases}$
How can I derive the MLE for this distribution? I know how to derive the MLE for $\lambda$ if $Y\sim\exp(\lambda)$ but I don't know how to work with this mixed distribution
If you maximize the log-likelihood function, then the idea is the same. Specifically, you want to maximize:
$$ \ell(\mathbf{x}, \mathbf{\lambda}) = \sum_{x_i \in [0,5)}\ln\left[\lambda e^{-\lambda x_i}\right] + \sum_{x_i = 5}\ln\left[e^{-5\lambda }\right] $$
If we have $m$ data points such that $ x_i \in [0,5)$ and $n$ data points such that $x_i = 5$, then the above expression is the same as:
$$ \ell(\mathbf{x}, \mathbf{\lambda}) = m\ln\left[\lambda\right] - \lambda \sum_{x_i \in [0,5)} x_i - 5n\lambda $$
which is the same as::
$$ \ell(\mathbf{x}, \mathbf{\lambda}) = m\ln\left[\lambda\right] - \lambda \sum_{x_i \in [0,5)} \left(x_i + \frac{5n}{m} \right) $$
From here you can, see that this essentially leads to the traditional MLE estimator for an exponential distribution:
$$ \hat{\lambda}_{\mathrm{MLE}} = \frac{m}{ \sum_{x_i \in [0,5)} \left(x_i + \frac{5n}{m} \right)} $$