What are the subdifferentials $\partial f(0)$ and $\partial f(1)$? Let $ f: \mathbb{R} \to \mathbb{R} $ given by
\begin{equation*}
f(x) = \left\{
\begin{array}{rl}
x \log x -x & \text{if } x \geq 0\\
\infty & \text{if else}\\
\end{array} \right.
\end{equation*}
What are the subdifferentials $\partial f(0)$ and $\partial f(1)$?

Definition: The set of all subgradient of $f$ at $x$ is called the subdifferential of $f$ at $x$:
$$ \partial f(x)=\{\alpha \in \mathbb{R}: f(y)\geq f(x) +\langle\alpha, y-x\rangle,\ \forall \ y\in \mathbb{R} \}$$
 A: The function is differentiable for $x>0$ with $ f'(x) = \log(x) $.
Since the function is differentiable at $x=1$ we have $\partial f(1) = \{f'(1)\}$ and then $ \partial f(1) = \{ 0 \} $.
I'll assume that you are setting $f(0)=0$. Suppose $\alpha \in \partial f(0)$, then
$$ f(y) \geq f(0) + \langle \alpha, y-0 \rangle = \alpha y $$
for all $y\in \mathbb{R}$. That holds for $y \leq 0$, assume now $y>0$, then we have
$$ y\log(y) - y \geq \alpha y \Rightarrow \log(y) \geq 1+\alpha $$
but since $\lim_{y\to 0}\log(y) = -\infty $ for any $\alpha$ we can find $y$ such that $\log(y)<1+\alpha$. Therefore:
$$ \partial f(0) = \emptyset $$
A: We need to separate the interior of the domain from boundary points.
When looking at the interior, it's just the derivative. At points a function is differentiable, the subdifferential set is a singleton and subdifferential $\iff$ derivative. Since $f^{\prime}(x) = \log x$ then $f^{\prime}(1)=\partial f(1) = \log 1 = 0$.
Now look at the boundary point. Recall the definition of the subdifferential set is $$f(y)\geq f(0)+\alpha(y-0), \quad \forall y\geq 0$$
which is the same as $y\log y -y\geq \alpha y \iff y(\log y - 1 -\alpha)\geq 0$. Take $y=1$ and you have $\alpha\leq -1$, and in particular, $\alpha<0$. Now take $y=e^{\alpha}$, we have: $$e^{\alpha}(\log e^{\alpha} -1 -e^{\alpha})\geq 0 \\ \alpha e^{\alpha} - e^{\alpha}-e^{2\alpha}\geq 0.$$
Notice that since $\alpha<0$ each of the above three terms is strictly negative. Therefore   $\alpha e^{\alpha} - e^{\alpha}-e^{2\alpha}< 0$ and we have a contradiction. To conclude $$\partial f(0) = \emptyset.$$
