For some $ak+bl=1$, where $a,b$ are positive integers and $k, l \in \mathbb{Z}$, consider the functions $f : \mathbb{Z}_{ab} \rightarrow \mathbb{Z}_a \times \mathbb{Z}_b$ and $g : \mathbb{Z}_a \times \mathbb{Z}_b \rightarrow \mathbb{Z}_{ab}$ such that
$$f(n) = ([n]_a, [n]_b)$$ $$g(x,y) = [ka(y-x) + x]_{ab}$$
We need to show that either $g \circ f = id_{\mathbb{Z}_{ab}}$ or $f \circ g = id_{\mathbb{Z}_a \times \mathbb{Z}_b}$.
This is very complicated to me but here is my attempt at solving it:
I suppose the id symbol simply means it gives the set of all $\mathbb{z}_{ab}$ so on and so forth.
Then I let $nka + nbl = n$. I then have the result that $nka \equiv n \pmod b$ since we can express every diophantine equation as a modular arithmetic expression.
But this also means that $n = [n]_b$ and without loss of generality $n = [n]_a$.
Then when considering $g\circ f$, we have $g(x,y) = g(n,n) = [n]_{ab}$, which shows that $g \circ f = id_{\mathbb{Z}_{ab}}$?
I'm not even sure what I'm doing make sense here. But I suspect step 3 is wrong, since it doesn't make sense that the number is the remainder itself when mod b, especially since it could be any integer.
Just to clarify a bit the notation. The map $id \colon A \rightarrow A$ refers to the identity map on an object $A$ (where $A$ may be monoid, group, vector space, smooth manifold, category and so on). What $id$ does is that it takes an element of your object and returns the very same element. E.g. if we take $id_{\mathbb{Z}_a \times \mathbb{Z}_b}$ that occurs in your question then $$id_{\mathbb{Z}_a \times \mathbb{Z}_b} \colon \mathbb{Z}_a \times \mathbb{Z}_b \rightarrow \mathbb{Z}_a \times \mathbb{Z}_b \ , \\ ([x]_a, [y]_b) \mapsto ([x]_a, [y]_b) \ . $$ Let mi show that taking $f$ and $g$ as you have defined them, the composition $f \circ g$ is indeed the identity map $id_{\mathbb{Z}_a \times \mathbb{Z}_b}$.
Take arbitrary element $ ([x]_a, [y]_b) \in \mathbb{Z}_a \times \mathbb{Z}_b$ (which is given by a pair of equivalence classes) and compute directly
$$ (f \circ g )([x]_a, [y]_b) = f ([ka(y-x) + x]_{ab} = ([ka(y-x) + x]_a, [ka(y-x) + x]_b ) \ .$$ Since adding multiples of $a$ does not change the modulo $a$ equivalence class (see this wiki article for more about modular arithmetic) we can omit the summand $ka(y-x)$ in $[ka(y-x) + x]_a$, i.e. $[ka(y-x) + x]_a = [x]_a$. The second guy $[ka(y-x) + x]_b$ is handled using the fact the $\gcd (a,b) = 1$ which you stated (using the Bezout's theorem) as $ka + bl = 1$ which is equivalent to $1 - ka = bl$ and to $ka = 1 - bl $.
Because $ ka(y-x) + x$ can be rewritten as $$ ka(y-x) + x = (ka)y + x (1 - ka) = (1-bl)y + x(bl) = y - (bl)y + x(bl) \ ,$$ we see that $$[ka(y-x) + x]_b = [y - (bl)y + x(bl)]_b = [y]_b \ ,$$ where we again omitted the terms multiplied by $b$ since this classes are considered modulo $b$. Altogether we see that $$f \circ g ([x]_a, [y]_b) = ([x]_a, [y]_b) \ .$$ Since the element $([x]_a, [y]_b)$ was chosen arbitrarily, we conclude $f \circ g = id_{\mathbb{Z}_a \times \mathbb{Z}_b} $.