Let $f:X\to Y$ be a map. When $A\in X$, we write the image of $A$ under $f$ as $f(A)$. On the other hand, when $A\subseteq X$, we write $\{f(a)\mid a\in A\}$ also as $f(A)$.
But this obviously creates some ambiguity: when $A$ is both an element and a subset of $X$, what does $f(A)$ mean then?
For example, let $X=\{1,\{1\}\}$, $Y=\{a,b\}$ and $f$ be defined by $f$ maps the element $1$ of $X$ to $a$ and the element $\{1\}$ to $b$. Then does $f(\{1\})$ mean $\{a\}$ or $b$?
I do not understand why such ambiguity still exists in elementary set theory.
It is ambiguous and can have either meaning, depending on context. Most of the time the intended meaning is clear, since unless you're doing axiomatic set theory you're not likely to encounter a set $A$ which you want to think of as both an element of and a subset of another set $X$. An alternate notation that is often used by set theorists (though not as much by general mathematicians) to avoid this ambiguity is to write $f[A]$ rather than $f(A)$ for $\{f(a):a\in A\}$.