Let $f \in C[a,b]$ and $g(x)$ be a real-valued function defined on [a,b]. Suppose $g(x) = f(x) \, a.e. \, \text{for } x \in [a,b]$. Is $g(x)$ necessarily almost everywhere continuous on $[a,b]$?
Yes. Since $f$ is continuous on $[a,b]$, then for any $x \in [a,b]$ and $\epsilon > 0$, there exists a $\delta > 0$ such that \begin{align*} \left|f(x) - f(y)\right| < \epsilon, \quad \forall \left|x - y\right| < \delta \tag{$\star$} \end{align*} Let $E$ denote the set on which $f$ and $g$ are exactly equal. Then by hypothesis, ${m([a,b]\setminus E) = 0}$, which implies $\left([a,b] \setminus E\right)$ contains no intervals. Now, select the $x$ in $(\star)$ to be in $E \subset [a,b]$. This implies $f(x) = g(x)$. Furthermore, the left side of $(\star)$ holds as long as $y \in [a,b]$ belongs to \begin{align*} \{y: x-\delta < y < x + \delta\} = \{y: y \in V_\delta = (x - \delta, x + \delta)\} \end{align*} But $m(x-\delta, x+\delta) = 2\delta$ and any subset $\left([a,b] \setminus E \right) \subset V_\delta$ must have (by hypothesis again) measure zero. Since E is all points in $[a,b]$ that are not in $\left([a,b] \setminus E \right)$, and $m\left(V_\delta\right) \neq 0$, there must exist a point $y \in V_\delta$ that belongs to $E$. And $y \in E \implies f(y) = g(y)$. So, since $|x-y| < \delta$, and $x,y \in E$, we have $|g(x) - g(y)| = |f(x) - f(y)| < \epsilon$, and therefore $g$ is continuous almost everywhere on $[a,b]$.
Editorial comment: You were given a perfectly clear counterexample. It should have been helpful - knowing that your proof is wrong should help find the error. Go through the proof with the counterexample in mind, looking for a step that the counterexample shows is incorrect.
You say you want an explanation of where your fundamental confusion lies. That's hard to say - you seem to be confused about almost everything. For example, in the deleted answer K says that $g$ is nowhere continuous, and then in a comment you ask if it could not nonetheless be continuous almost everywhere. That is so confused it's hard to explain what the confusion is, exactly. But no,
Proof: The complement of the empty set does not have measure zero. qed.
It's impossible to say what your confusion was when you made that comment. Maybe you thought that the complement of the empty set had measure zero. Maybe you didn't understand what "almost everywhere" means. Who can tell?
In any case, since you're not willing to do any of this on your own I'll tell you about at least one fundamental confusion in the proof in your original post. At the end you appear not to know what the word "continuous" means. To show $g$ is continuous at $x$ you need to show this:
(i) For every $\epsilon>0$ there exists $\delta>0$ such that if $|x-y|<\delta$ then $|g(x)-g(y)|<\epsilon$.
What you actually show, perhaps, is this:
(ii) For every $\epsilon>0$ there exists $\delta>0$ such that if $|x-y|<\delta$ and $y\in E$ then $|g(x)-g(y)|<\epsilon$.
BY the way, the answer you posted is simply wrong. Saying $g$ is continuous almost everywhere does not imply that $g$ is continuous on some interval. Standard example: Define $g(x)=0$ is $x$ is irrational. If $x$ is rational, say $x=p/q$ in lowest terms and define $g(x)=1/q$. It easy to see $g$ is continuous at $x$ if and only if $x$ is irrational. So $g$ is continuous almost everywhere but there is no interval on which $g$ is continuous.
Details: You can find a proof that $g$ does what I claim onWikipedia or MSE by googling "Thomae's function". Or, since I don't particularly like those expositiions, here:
First suppose $x=p/q$ is rational. It's obvious that $g$ is not continuous at $x$: There is a sequence $(x_n)$ of irrationals converging to $x$, but $\lim g(x_n)=0\ne 1/q=g(x)$.
Now suppose $x$ is irrational. Let $\epsilon>0$. There are only finitely many rationals $r=p/q\in(x-1,x+1)$ with $q\le 1/\epsilon$. Hence there exists $\delta\in(0,1)$ such that if $r=p/q\in(x-\delta,x+\delta)$ then $q>1/\epsilon$. So if $|x-y|<\delta$ then $|g(x)-g(y)|<\epsilon$ (consider the cases $y$ rational and $y$ irrational separately: If $y$ is irrational then $|g(x)-g(y)|=0<\epsilon$, while if $y=p/q$ is rational then $|g(x)-g(y)|=1/q<\epsilon$, since $q>1/\epsilon$.)
No, I can't explain what your confusion was in that answer. Saying $g$ is continuous almost everywhere simply does not mean what you say it means -- I have no idea why you thought it did mean that.
(But no, K did not point out what you say he pointed out.)