We know that given some function, each element of its domain has only one image in its codomain. But is it possible for an image of some element to have two preimages?
For example, the function $f:\Bbb R\to\Bbb R$ defined by $f=\{(x,f(x))\mid f(x)=\sqrt{x}\}$ has two preimages for some elements. Now I am confused is it true or not. Is it?
This is certainly possible. Consider $f:\Bbb R\to\Bbb R$ with $f(x):=x^2$. Then the image $4$ has preimage $\pm 2$. Indeed, for any $y>0$ there are two preimages under $f$, i.e. $\pm\sqrt y$. Another example is $g:\Bbb R\to\Bbb R$ with $g(x):=\sin(x)$. In this case, for any $-1\leq y\leq 1$ in the image, there are infinitely many preimages for $y$ under $g$ (due to the periodic nature of $g$).
When a function has a unique preimage for every element of the image, we say that the function is injective. Perhaps you've heard of the "vertical line test" for a function; well the "horizontal line test" determines whether a function is injective or not (when it can be plotted on the Cartesian plane).
I will note that $h:\Bbb R\to\Bbb R$ with $h(x):=\sqrt x$ is actually injective, and therefore has a unique preimage for every image. Indeed, $\sqrt x=\sqrt y\implies x=y$.