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.
Suppose I say: $f(x) = $ some number greater than $x$

Then of course you say 'well, that could be lots of things, e.g. f(5) could be 6, or 7, or ... So, what *is* it?!'

OK, so the problem is that this 'function' does not uniquely specify what f(x) is for any x, i.e. You could have x= 5 , y= 5, but f(x) = 6, and f(y) = 7. So, it is not well-defined, since in this case x=y does apparently not imply f(x) =f(y).

Indeed, most mathematicians therefore don't consider this a function at all! That is, typically we say that a function *must* have the feature that function values are uniquely defined or else it is just not a function. You probably think about it that way as well, which is why you see functions as *automatically* well-defined, wondering what the requirement that functions are well-defined is all about: aren't they by definition of being a function well-defined?!

Well, you have to realize that the function at some point does need to be defined ... And if our definition is a complicated one, it may not be immediately clear whether it is well-defined our not. So, we always have to make sure that what we *intend* to be be our 'function' is *in fact* well-defined. This is what we are really after when we say that functions need to be well-defined.