Let $f(x)$ be continuous in $[a,b]$
Let $A$ be the set defined as: $$A = \{ x \in [a,b] \mid f(x) = f(a) \}$$
Does $A$ have a maximum? I guess it it is the max value in $[a,b]$ which $f$ sends to $f(a)$ but I don't know how to prove it.
Would it still have a maximum if $[a,b]$ would turn into $[a,b)$?
Since $A$ is a subset of the bounded set $[a,b]$, $A$ is also bounded, and since $a\in A$, $A$ is not empty. Consequently, $A$ has a supremum, $s$, say. Note that this reasoning does neither require $f$ be continuous nor that $b$ is contained in the interval (as long as $a<b$, but if $a=b$, $[a,b)$ doesn't make any sense.).
However, if you are interested in showing that (or if) $s$ is also a maximum, you need to use the continuity: Since $A=f^{-1}(\{f(a)\})$ is the preimage of a closed set under a continuous function, $A$ is closed and hence contains $s$. Thus, $s$ is even the maximum.
Here is another way to show this: Since $s=\sup(A)$, there is a sequence $(x_k)\subset A$ converging to $s$. Thus, $f(x_k)=f(a)$ for all $k$, and since $f$ is continuous, $f(s)=f(a)$, showing that $s\in A$, so $s$ is indeed the maximum of $A$.