Question: A function is said to be well defined if x=y implies f(x)=f(y). If x=y then surely wont f(x)=f(y). I cant get this through my head. Plz explain what a well defined function is n what is an ill defined one. It puzzles me a lot to think of an ill defined one.

Answer: 
One example of a not-well-defined function would be $f(\frac{a}{b})=a+b.$
Then, while $\frac{1}{2} = \frac{2}{4}$, we have $f(\frac{1}{2}) = 3$ but $f(\frac{2}{4})=6.$ So you'll often see, in proofs about rational numbers, that the fractions is specified to be "in lowest terms" and maybe "with denominator positive", so that the operations given are well-defined.
A function $f$ is well defined or 'single-valued' in the sense that $(a,b)\in f$ and $(a,b')\in f$ imply that $b=b'$. This operation is written as $f(a)=b$.

What this means is, that a single element of $A$ cannot have more than one image in $B$ under $f:A\to B$. Thus the mapping $f$ is a particular relation $f\subset A\times B$.