Uniqueness fails only for numbers that have a ternary expansion ending in an infinite string of $2$’s, e.g., $0.2122222\dots$, which is equal to $0.22$, or $0.2022222\dots$, which is equal to $0.21$. These examples are typical of the two possibilities:
- If the digit immediately before the final string of $2$’s is $0$, the other representation of the number terminates in a $1$.
- If the digit immediately before the final string of $2$’s is $1$, the other representation of the number terminates in a $2$.
In each case one of the two representations must contain a $1$. Thus, at most one of them can arise from the map in question, which therefore must be injective.
Added: To see that the first statement is true, suppose that $\sum_{k\ge 0}\frac{a_k}{3^k}=\sum_{k\ge 0}\frac{b_k}{3^k},$ where $a_k,b_k\in\{0,1,2\}$ for all $k$. Then $\sum_{k\ge 0}\frac{a_k-b_k}{3^k}=0\;,$ where each $a_k-b_k\in\{-2,-1,0,1,2\}$. Let $m=\min\{k:a_k-b_k\ne 0\}$; then $\frac{a_m-b_m}{3^m}+\sum_{k>m}\frac{a_k-b_k}{3^k}=0\;.$
Without loss of generality we may assume that $a_m-b_m<0$, so that $a_m-b_m$ is $-1$ or $-2$, and $\frac{a_m-b_m}{3^m}\le-\frac1{3^m},$ and hence $\sum_{k>m}\frac{a_k-b_k}{3^k}\ge\frac1{3^m}.$
But $\sum_{k>m}\frac{a_k-b_k}{3^k}\le\sum_{k>m}\frac2{3^k}=\frac{2/3^{m+1}}{1-1/3}=\frac1{3^m},$ so the only possibility is that $a_m-b_m=-1$ and $\sum_{k>m}\frac{a_k-b_k}{3^k}=\frac1{3^m}.$ If $a_k-b_k$ were less than $2$ for some $k>m$, we’d have $\sum_{k>m}\frac{a_k-b_k}{3^k}<\sum_{k>m}\frac2{3^k}=\frac1{3^m},$ so we must have $a_k-b_k=2$ for every $k>m$. Since $a_k,b_k\in\{0,1,2\}$, this implies that $a_k=2$ and $b_k=0$ for every $k>m$. Similarly, either $a_m=0$ and $b_m=1$, or $a_m=1$ and $b_m=2$. In the first case the $a$ expansion ends in $\dots0222\dots$ and the $b$ expansion in $\dots1$; in the second, the $a$ expansion ends in $\dots1222\dots$ and the $b$ expansion in $\dots2$. These are cases (1) and (2) above.