Let $a,b,c \in \mathbb{R}$ such that $a < b < c$. Define the sets: $$A := [a,b], B := [a,b] \cup \{c\}.$$I claim that there exists a bijection $f: A \to B$, i.e.,that $A$ and $B$ have the same cardinality.
To proof this, I choose $\varepsilon \in (0, b-a)$ and define the function $f:[a,b] \to [a,b] \cup \{c\}$ as follows:
$$f(x) = \begin{cases} \text{$c$}, & \text{if $x = a$} \\ \text{$x - \varepsilon$} & \text{if $x \in [a + \varepsilon,b]$} \end{cases}$$
My Idea is to "send" a to c, and shift all other values in $[a +\varepsilon, b]$ to left by $\varepsilon$, effectively filling the gap at $a$.
Now I’m asking: Is this a valid bijection, and does this argument correctly show that $A$ and $B$ are equinumerous?
I know there are many existing solutions to similar problems, but I’m not looking for a new one — rather, I’d like verification that my specific approach is correct.
Thank you in advance and best regards!