Well defined function meaning 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. 
 A: 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$.
A: 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.
A: What makes the concept of a well-defined function $f$ confusing is the fact that functions are by definition well-defined.  So to explain what it means to not be well-defined, we have to take an example where $f$ is not a function.
Lets take the following procedure and call it $f$:  The input is an integer $n$. The output of $f$ is an element of $\{n+1,\ldots,n+6\}$ determined by rolling a dice. This procedure takes an integer $n$ as input, and returns an integer as output. But it is not well-defined, because if you compute $f(n)$ several times for the same $n$, you do not always get the same output. The term used to describe this behavior is to say that $f$ is not well-defined.
Suppose you have some procedure $f$ that takes as input an element of a set $X$, and returns as output an element of a set $Y$. Then you may only call $f$ a function if you can prove that $x=y$ implies $f(x) = f(y)$. This might seem obvious at first, but it is often non-trivial. For example, suppose that the procedure $f$ involves choosing an element of some non-empty set.  In this case, to prove that $f$ is well-defined (and thus: a function), you have to prove that any choice you could have made will result in the same output $f(x)$.
A: 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.
