The problem is as follows:
Let $A$ be a dense set in $\mathbb R$. Prove that if $f$ is continuous and $f(x) = 0$ for all numbers $x \in A$, then $f(x) = 0$ for all $x \in \mathbb R$.
I was wondering if I could possibly do a proof without using contradiction. My proof is below:
Let $x \in \mathbb R$. Because $f$ is continuous, $\forall \epsilon > 0$, there exists $\delta > 0$ such that if $0 < |y-x| < \delta$, then $|f(y) - f(x)| < \epsilon.$ And because $A$ is dense in $\mathbb R$, for appropriate $\delta > 0$ given any $\epsilon$, there exists $y \in A$ such that, $0 < |y-x| < \delta$, so $|f(x)| < \epsilon.$ Hence, because $|f(x)| < \epsilon$ for every $\epsilon > 0$, $f(x) = 0$.
Just curious if this proof works at all, logically. I am aware of how to prove this with contradiction, but really wondering if this proof makes sense. Thank you!
Here's a proof without contradiction.
Let $x\in\mathbb{R}-A$. Since $A$ is dense there exists a sequence $ \{x_n\}\subset A$ such that $x_n\to x$. Now, since $ \{x_n\}\subset A$ we have $f(x_n)=0$ for all $n$. Thus, $\lim_{n\to\infty}f(x_n)=0$. But, by continuity, $0=\lim_{n\to\infty}f(x_n)=f(\lim_{n\to\infty}x_n)=f(x)$.
The OP's proof looks good to me and has been phrased a little better by CopyPastelt.
mesel's comment that the $0<|x-y|<\delta $ part of the statement is not necessary I think is incorrect. For example, set $f(x)=0$ for $x\neq 0$ and $f(0)=1$. Clearly, $\lim_{x\to 0}f(x)=0$. Look at the proof of this: let $\epsilon>0$. Take $\delta=\epsilon$. For $0<|x-0|<\delta$ we have $|f(x)-0|=|0-0|<\epsilon$. However, if we allow $x=0$ by using the weaker condition $|x-0|<\delta$ then the statement can be evaluated at $x=0$ giving $|f(0)-0|=|1-0|<\epsilon$, which won't hold for all $\epsilon$.