Are following statements correct? [Extrema, derivatives]

I have a few questions on the topic of extrema and derivatives:

1. Consider a differentiable function $$f:\mathbb{R}\to\mathbb{R}$$ that reaches its maximum in $$a\in\mathbb{R}$$. This implies that $$f'(a)=0$$.

I think this is true. We now that $$f$$ is differentiable over $$\mathbb{R}$$, so $$f'(a)$$ exists. Because a (global) maximum is always a local maximum, we can conclude that $$f'(a)=0$$.

1. If $$f \in C^1([0,1])$$ reaches its maximum in a point $$a\in [0,1]$$, then $$f'(a)=0$$.

This isn't necessarily true when $$a=0$$ or $$a=1$$, because then we're not working with an interior point ($$f$$ is differentiable over $$]0,1[$$).

Are my answers and way of thinking correct? Thanks for helping!