Let $g:\mathbb R \to\mathbb R$ and $h:\mathbb R \to \mathbb R$ be continous functions with $g(c) = h(c)$.
Define $f:\mathbb R \to \mathbb R$ by
$$f(x)= g(x), x \in \mathbb Q \\ f(x)= h(x), x \in \mathbb R -\mathbb Q$$
Prove that $f$ is continuous at $x=c$.
Since $g$ is continuous, $\forall \epsilon>0,\exists \delta_1>0$ such that $|x-c|<\delta_1 \implies |g(x)-g(c)|<\epsilon$
Since $h$ is continuous, $\forall \epsilon>0,\exists \delta_2>0$ such that $|x-c|<\delta_2 \implies |h(x)-h(c)|<\epsilon$
I'm not quite sure how to continue from this.
I'm thinking of setting $\delta = \min \{\delta_1,\delta_2\}$.
I don't think left and right limits would work because of the domain of $g$ and $h$.