Proving f(x)=g(x) for all real numbers if f(x)=g(x) for all rational numbers Before I even start my question, I want to let all readers know that this problem is on my homework assignment and I do not want a complete answer. All I ask for is some help with how I can approach such a problem. I know it is frowned upon in the math.stackexchange community to ask homework questions and rightly so. Therefore, I want to make it clear before any of you decide to proceed further and help me. The only reason I am asking is because my back is against the wall and I don't know what I should be doing to get closer to the result.
The problem is as follows:

Let $f$ and $g$ be functions, and suppose $f$ and $g$ are continuous on the open interval $(−∞, ∞) = \mathbb{R}.$
  (In particular, this means $D(f) = \mathbb{R}, D(g) = \mathbb{R})$. Suppose that for every rational number $x ∈ \mathbb{Q}$,
  we have $f(x) = g(x)$. Prove that $f(x) = g(x)$ for every number $x ∈ \mathbb{R}$.

What I have so far is that I can use closure of rationals to prove it by creating a new function like $h(x)=f(x)-g(x)$. However, this is an introductory calculus course and we haven't really looked at closure of sets. I am only allowed use of limit properties, epsilon-delta definitions, density property of rationals and irrationals and definitions of one-sided and limits at infinity. I am not able to think of a way to approach the problem with just this restricted knowledge. No use of sequences or series or expansion of series are allowed.
Again, I only want an approach to the problem and not a solution. If you want to post a solution, please do so at your own discretion or after 12 October, 2018.
 A: A bit more abstract:


*

*The set $\{\,x\in\Bbb \mid f(x)\ne g(x)\,\}$ is open

*The set $\Bbb Q$ is dense in $\Bbb R$.

A: Well, take any real number $x$. There is a sequence $(q_{n})$ of rational numbers that converge to $x$. Now, $h$ is continuous and vanishes on each $q_{n}$, so...
EDIT:
Since you can't use sequences, fix $x\in\mathbb{R}$. Let $\epsilon>0$ be arbitrary. Since $h$ is continuous, you can find a $\delta>0$ such that $|h(x)-h(y)|<\epsilon$ provided $|x-y|<\delta$. Choose a rational $q$ such that $|x-q|<\delta$. Then, $|h(x)|=|h(x)-h(q)|<\epsilon$. Since $\epsilon>0$ was arbitrary, it follows that for any $\epsilon>0$, $|h(x)|<\epsilon$. Thus, taking $\epsilon$ to $0$ you obtain:
$$
|h(x)|\leq\lim_{\epsilon\rightarrow0}\epsilon=0.
$$
So, $h(x)=0$.
A: Let $y$ be irrational, and let $\epsilon > 0$ be given.
Since $h$ is continuous, there exists $\delta > 0$ with the property that $$|y-x| < \delta \implies |h(y) - h(x)| < \epsilon.$$
The density of rationals means there is always a rational number $x$ satisfying $|y-x| < \delta$.
What can you conclude about $h(y)$?
A: Proof by contradiction. Assume $\exists x_0\in\mathbb R : h(x_0)\neq 0$. Define $\epsilon_0 = |h(x_0)| > 0$. Knowing that $h$ is continuous and 0 on $\mathbb Q$, use the $\epsilon$-$\delta$ continuity requirement on $h$ to arrive at a contradiction for $\epsilon=\epsilon_0$ at $x=x_0$. From the contradiction, conclude that $\forall x\in\mathbb R:h(x)=0$.
