Value of derivative at a particular point We were recently asked in class whether $f:X \to \mathbb{R}$ with $f'\equiv 0$ implies $f$ is constant. 

Of course, if we take $X=(0,1)\cup (2,3)$ with $$f(x)=1\text{ when } x\in (0,1)$$
$$f(x)=2\text { when } x \in (2,3)$$

I could work out through this. Then I thought whether taking $X=[0,1]\cup [2,3]$ would yield the same result. I am confused whether $f'(1)$ would be $0$ or not, since of course right hand limit does not exist.
It's not usually (ever?) useful to define derivatives on points that aren't in the interior of an open set. In fact it's discourageable to do so via one-sided limits, because a function could then be differentiable at $a$ over $[a,b]$, but not on $[a-\varepsilon,b]$ (for instance the absolute value function on $[0,1]$). See this question and its answers for some discussion.

With this in mind, the answer to your question is that $f'(1)$ could be $0$ if you want it to be, but this definition of derivative at a point isn't meaningful so there's no reason to consider the point $x = 1$ anyways (and besides you've already answered the question of whether $f' \equiv 0\implies f\equiv \mathrm{constant}$ with the example on open intervals).
It's not usually (ever?) useful to define derivatives on points that aren't in the interior of an open set. In fact it's discourageable to do so via one-sided limits, because a function could then be differentiable at $a$ over $[a,b]$, but not on $[a-\varepsilon,b]$ (for instance the absolute value function on $[0,1]$). See this question and its answers for some discussion.

With this in mind, the answer to your question is that $f'(1)$ could be $0$ if you want it to be, but this definition of derivative at a point isn't meaningful so there's no reason to consider the point $x = 1$ anyways (and besides you've already answered the question of whether $f' \equiv 0\implies f\equiv \mathrm{constant}$ with the example on open intervals).