Show that if $f=g\ \text{a.e.}$ on $[a,b]$ implies that $f=g$ on $[a,b]$. 
Suppose that $f,g$ are continuous functions on $[a,b]$. Show that if $f=g\ \text{a.e.}$ on $[a,b]$ then in fact $f=g$ on $[a,b]$.

Is the result true if $[a,b]$ is replaced by any measurable set?
My effort:
Let $A=\{x\in [a,b]:f(x)\neq g(x)\}$. It is given that $\mu(A)=0$ where $\mu$ denotes measure of a set.
To show that $A=\emptyset$. Suppose that $A\neq \emptyset $. Let $p\in A$. Then $f(p)\neq g(p)$ and also $f,g$ are continuous at $p$.
As $\mu(A)=0$ then there exists a sequence of intervals $\{I_n\}$ such that $A\subset \bigcup_{n=1}^\infty I_n$ and $\sum_{n=1}^\infty l(I_n)<\epsilon$ for any $\epsilon>0$.
But I am unable to use the continuity of $f,g$. Please give some hints.
 A: We assume $f$ and $g$ are equal a.e. on $[a,b]$ with the set $A=\{x \in [a,b]|f(x)\neq g(x) \}$ and $m(A)=0$. We wish to show that $A$ is empty. Since the text only defines continuous real-valued functions we will assume $f$ and $g$ only take on real values so $f-g=0$ on $[a,b] \setminus A$. Next $f$ and $g$ are both continuous so $f-g$ is continuous. Thus we know that for any arbitrary $x \in [a,b]$, $f-g$ is  continuous. By definition of continuous at a point $x \in [a,b]$, for any $\epsilon > 0$ there exists a $\delta > 0$ such that if $x' \in [a,b]$ and $|x-x'|<\delta$ then $|(f(x)-g(x)) - (f(x')-g(x'))|<\epsilon$. If we restrict $\delta<b-a$ then  $|x-x'|<\delta$ defines the interval $(x-\delta,x+\delta) \cap [a,b]$ such that $m((x-\delta,x+\delta) \cap [a,b])\geq \delta$.
The interval $(x-\delta,x+\delta) \cap [a,b]$ will contain points in $[a,b] \setminus A$ because its measure is greater than the measure of $A$. If we let $x'$ be an arbitrary point in $(x-\delta,x+\delta) \cap ([a,b]\setminus A)$ we know that
$$|(f(x)-g(x)) - (f(x')-g(x'))|<\epsilon$$
$$|(f(x)-g(x)) - 0)|<\epsilon$$
$$|f(x)-g(x)|<\epsilon.$$
Since $\epsilon$ is arbitrary this implies that $f(x)=g(x)$ for all $x\in A$ resulting in $f=g$ on $[a,b]$.
A: The function $h(x)=f(x)-g(x)$ is also continuous. Let $U=\{x: f(x)=g(x)\}.$ 
Then $U=h^{-1}\{0\}.$ So $U$ is closed.
Also, $U$ is  dense in $[a,b].$ Otherwise some open interval $(c,d)\subset [a,b],$ with $c<d,$ is disjoint from $U.$ But then $\mu (A)\geq d-c>0,$ where $A=\{x\in [a,b]: f(x)\ne g(x)\}.$ 
A closed dense subset of $[a,b]$ must equal $[a,b].$ So $U=[a,b].$
A: Replacing $[a, b]$ by another measurable set won't work - consider the set $X = [0, 1] \cup \{2\}$. Say $f(x) = 0$ for all $x$ and $g$ is the characteristic function of $\{2\}$. Then $f = g$ on $[0, 1]$, and hence almost everywhere on $X$; but $f \neq g$.
The key part of the proof you're looking for will have to do with the fact that nearby points will have nearby $f$-values (and likewise with $g$); if I were you, I'd try to prove that if $f(x) \neq g(x)$ then there is an entire interval around $x$ on which $f \neq g$.
A: Suppose $f:[a,b]\rightarrow \mathbb R$ and $g:[a,b]\rightarrow \mathbb R$ are distinct.
Then there is an $x_0\in [a,b]$ with $f(x_0)\neq g(x_0)$
By continuity there is  $\delta>0$ so that $f(x)\neq g(x)$ for all $x\in (x_0-\delta,x_0+\delta)\cap[a,b]$.
This set has measure larger than $0$, so we conclude $f$ and $g$ are not equal almost everywhere.

If we change $[a,b]$ with any other measurable set the result may not hold, for example $\{0\}$ is a measurable set (it's measure is zero).
If $f,g$ are any two functions from $\{0\}$ to $\mathbb R$ , then $f$ and $g$ are continuous, and clearly $f=g$ a.e. But of course $f$ must not be equal to $g$ necessarily.
A: 
Suppose that $ f,g$  are continuous functions on $[a,b]$.  Show that
if $f=g $ a.e. on $[a,b] $ then in fact $ f=g$ on $ [a,b]$

$A=\{x\in [a,b]:f(x)\neq g(x)\}$

Theorem: $(X, \tau) $ and $(Y, \tau') $ be two topological space and
$(Y, \tau') $ is Hausdorff. $f, g $ two continuous functions .
Then $\{x\in X :f(x) =g(x) \}$ is a closed set in $X$.

From the above theorem it follows that $A$ is an open set in $[a, b]$.
Claim :$A=\emptyset$
Asaume the contrary, $x_0\in A$
Then, $\exists \delta>0$ such that
$(x_0-\delta, x_0+\delta)\subset A $
Now, by monotonicity of measure,
$m((x_0-\delta, x_0+\delta))\le m(A )$
Hence, $m(A) \ge 2\delta>0$
Contradiction!
2nd part:
Choose, $\Bbb{Z}\cup\{\frac{1}{2}\}$
Consider, $f(x) =\sin(\pi x) $
Then, $f(x)=0$ a.e on $\Bbb{Z}\cup\{\frac{1}{2}\}$
But $f \neq 0 $ on $\Bbb{Z}\cup\{\frac{1}{2}\}$
