Define $f$ on $[0, 4]$ by $f(x) = x+ 1$ for $0 ≤ x < 2$ and $f(x) = 1$ for $2 ≤ x ≤ 4$. Use the extreme value theorem to show that f is not continuous
So I'm having a little hard time doing this problem.
As I understand it, the extreme value theorem says
$\{f:[a,b]↦ω | ω⊆ℝ Λ a,b∈ℝ\} ⇒ \{∀p|p∈[a,b]:\lim \limits_{x \to p}f(x)=f(p)⇒∃c,∃d|c,d∈[a,b] : f(c) = \sup f ∧ f(d) = \inf f\}$
So, I imagine that in order to solve this problem, I should use the converse
$\{f:[a,b]↦ω | ω⊆ℝ Λ a,b∈ℝ\} ⇒ \{∀c,∀d|c,d∈[a,b] : f(c) ≠ \sup f ∨ f(d) ≠ \inf f ⇒ ∃p|p∈[a,b]:\lim \limits_{x \to p}f(x)≠f(p)\}$
So, if this is the graph of the function
I should prove that $f$ doesn't reach either its maximum or its minimum in $[a,b]$, and this would be a sufficient condition for $f$ not to be continuous in $[a,b].$ It's kinda' clear from the graph, but I'm having trouble proving it analytically.
What I see is that $\lim \limits_{x \to 2^{-}}f(x)=3$, so if $f(2)=3$, according to the graph, $3$ would be the maximum, but $f(2)=1$ so it never actually reaches its maximum. I could get closer and closer to $2$ in the domain and find the images of such values in the range closer and closer to $3$, but when actually reaching $2$, it wouldn't reach $3$, but $1$, thus not reaching the maximum. However, I don't know if this reasoning is either correct or formal enough. It feels more like an intuition.
Could you help me? Thanks in advance.

Suppose on the contrary that it is continuous, then by extreme value theorem, then there is a maximum.
Let's prove that $f([0,2))=[1,3)$,
Let $y \in f([0,2))$, then there $\exists x \in [0,2)$ such that $f(x)=x+1=y.$ $0 \le x < 2 \implies 1 \le y< 3.$
Conversely, if $y \in [1,3)$, then we have $y-1 \in [0,2)$ and we have $f(y-1) =y$. Hence $y \in f([0,2)$.
$$f([0,4])=f([0,2))\cup f([2,4])=[1,3) \cup \{1\}=[1,3)$$
and it doesn't have a maximum value.