I think you will find that almost everyone has this problem when they first starting to learn rigorous mathematics, and many students will never overcome this difficulty.
The following three statements are logically equivalent to each other, but students will almost all find the first to be easier to understand than the second, and will not be mature enough to really understand the third (although they may like it for its brevity). However, mathematicians almost universally prefer the second definition.
- A function $f:X \to Y$ is not injective if and only if there exist $x_1, x_2 \in X$ with $x_1 \neq x_2$ and $f(x_1) = f(x_2)$.
- A function $f: X \to Y$ is injective if and only if $f(x_1)=f(x_2)$ implies $x_1=x_2$ for all $x_1,x_2 \in X$.
- A function $f: X \to Y$ is injective if and only if each element in the image of $f$ has a unique preimage.
It is easy to show a function is not injective: you just find two distinct inputs with the same output. Students can look at a graph or arrow diagram and do this easily. If given a function they will look for two distinct inputs with the same output, and if they fail to find any, they will declare that the function is injective. This conception fits extremely well with the first definition.
The second definition is equivalent, but this equivalence is not at all obvious to students. They are not accustomed to performing logical transformations as complex as this "on the fly". However, mathematicians almost universally prefer this definition (and for good reason: it leads to a much simpler proof structure when you actually want to prove that a function is injective, and it is much easier to use when you know a function is injective.)
Here is the symbolic proof of equivalence:
&\neg [ \exists x_1 \in X \exists x_2 \in X (x_1 \neq x_2) \wedge (f(x_1) = f(x_2))] \\
&\equiv \forall x_1 \forall x_2 \neg [(x_1 \neq x_2) \wedge (f(x_1) = f(x_2))]\\
& \equiv \forall x_1 \forall x_2 (x_1 = x_2) \vee \neg (f(x_1) = f(x_2))\\
& \equiv \forall x_1 \forall x_2 (f(x_1) = f(x_2)) \implies (x_1 = x_2)
I think students could have conceptual trouble with any line of this reasoning (even subconsciously). For instance, they could have trouble negating universally quantified statements, they could have trouble with de Morgan's laws, although I expect that most of them will get hung up on the last step (realizing that $p \implies q$ is equivalent to $\neg p \vee q$).
The second definition is hard for students to swallow for a number of reasons: we state that $f(x_1) = f(x_2)$ in the hypothesis. For many students, if we have given a different name to two variables, it is because the values are not equal to each other. Then in the conclusion, we say that they are equal! Then the student might say "why did I give them two different names in the first place!?!". We did so to imagine a world where $x_1$ and $x_2$ are not equal, and yet their function values agree. We want to rule that world out, which is why we have the implication. Students are used to only thinking about the $T \implies T$ part of the implication truth table, but here we are using that $T \implies F$ is false: we are ruling out the hypothesis being true while the conclusion is false by declaring that the implication is true.
The third definition adds an extra complication. We might say something like 3. as a clarifying remark. Since it is mostly devoid of logical complication (these are swept under the rug with the words "image", "preimage", and "unique"), this feels easier for the student. However, they are in danger because they do not actually have a rigorous understanding of the meaning of these words. This is the definition I think they are trying to mimic when they say "a function is one-one if every element in the domain has a unique image". Some students may also make this error because of a faulty linguistic assumption: thinking at "one to one" means "one element goes to one element". I love @Thierry's suggestion in another answer to replace "one to one" with "two to two" to address this linguistic trap.
This is my diagnosis of the problem, but I do not have great solutions for you. I see it in all of my upper level math classes: discrete math (where they are first introduced to injectivity), linear algebra, number theory, abstract algebra, etc. I do not have a good solution. Occasionally I will meet with a student intensively in office hours and discuss these points for hours. Some of these encounters do seem to fix the difficulty, but I cannot pinpoint what made it "click" for the student. It seems like an extremely persistent problem, and is probably indicative of some deep barriers to advancing in mathematics which I do not currently understand or know how to help people overcome.
One thing which has helped a bit (I think) is giving explicit names for the following distinct concepts:
A relation $R \subset X \times Y$ is said to be
- single valued iff $(x,y_1) \in R$ and $(x,y_2) \in R \implies (y_1 = y_2)$.
- total iff for all $x \in X$ there exist $y \in Y$ with $(x,y) \in R$.
- injective iff $(x_1,y) \in R$ and $(x_2,y) \in R$ implies $x_1 = x_2$
- surjective iff for all $y \in Y$ there exist $x \in X$ such that $(x,y) \in R$.
This way I can at least verbally discuss student errors: when students give the false definition you mention I can say "No, you are just saying that $f$ is single valued, which is part of the definition of a function".