Example of two functions that are equal almost everywhere?

$\newcommand{\R}{\Bbb R}$ There are other sets of measure $0$. For example $Z=\{1\}$ has measure $0$. Consider $f:\R\to \R$ the function defined by $$f(x)=x,$$ and $g:\R\to\R$ given by $$g(x)=\begin{cases} x &\text{if $x\neq 1$}\\ \pi &\text{if $x=1$}\end{cases}$$ Then $f=g$ a.e. since $f\neq g$ on $Z$.


Let $f$ map all real numbers to $0$ and $g$ map all irrationals to $0$ and all rationals to $1$. Then $f$ and $g$ are distinct but equal a.e.


Consider a measure zero set i.e. $E_1$ such that $\mu(E_1) = 0$. Let $$h(x) = \begin{cases} 0 & x \in E_1^c\\ \text{any value} & x \in E_1 \end{cases}$$ Now consider any function $f(x)$. Then $g(x) = f(x) + h(x)$ satisfies your criteria.