You can start by showing that if $f \colon [a,b] \rightarrow \mathbb{R}$ is a bounded function and $c \in (a,b)$ such that both $f|_{[a,c]}$ and $f|_{[c,b]}$ are Riemann integrable, then $f$ is Riemann integrable and
$$ \int_a^b f(x)\, dx = \int_a^c f(x)\, dx + \int_c^b f(x) \, dx. $$
Then, prove that for any $a < x_0 < b$ and $y_0 \in \mathbb{R}$, the function
$$ f_{x_0,y_0}(x) := \begin{cases} y_0 & x = x_0 \\ 0 & x \neq x_0 \end{cases} $$
is Riemann integrable on $[a,b]$ with integral zero. The argument will be the same argument as for your $f_1$.
Now, choose some $\frac{1}{2} < a_1 < 1$. On $[a_1,1]$, your function $f$ is just $1 - f_{1,1}(x)$ and thus, is Riemann integrable. On $[\frac{1}{2},a_1]$, your function is just $1 - f_{\frac{1}{2},1}$ and thus is also Riemann integrable. By the result above, $f|_{[\frac{1}{2},1]}$ is Riemann integrable. Continuing this way inductively, you can see that $f|_{[\frac{1}{n},1]}$ is Riemann integrable for all $n \in \mathbb{N}$. Alternatively, if you already know that a function with finitely many discontinuities is Riemann integrable, you can skip all of the above.
Finally, using the definition of the Riemann integrable directly, show that if $f \colon [a,b] \rightarrow \mathbb{R}$ is a bounded function such that $f|_{[a + \frac{1}{n},b]}$ is Riemann integrable for all sufficiently large $n$, then $f$ is Riemann integrable and
$$ \int_a^b f(x) \, dx = \lim_{n \to \infty} \int_{a + \frac{1}{n}}^b f(x)\, dx. $$
Let $B$ be the set of all $x \in A$ such that $f(x) \neq g(x)$. Then $B$ is finite by assumption and $B \subset A$. So $B$ has Lebesgue measure $0$. Note that $A = A\setminus B \cup B$; so the measure of $A$ is the measure of $A \setminus B$ plus the measure of $B$, and hence $A = A \setminus B$ in measure. Note that $A \setminus B$ is the set of all $x \in A$ such that $f(x) = g(x)$. Then $\int_{A}f = \int_{A\setminus B} f = \int_{A \setminus B} g = \int_{A}g$.
Note: The Riemann and Lebesgue integration consideration in the question was just made clear after this answer was posted.
Best Answer
Hint:
If $f$ is continuous at $x$ and $g$ is continuous at $f(x)$, then $g\circ f$ is continuous at $x$.