Definition of "well defined" in mathematics I have encountered this term "well defined" in many places in maths like well-defined set, well-defined function, well-defined group, etc. What are the contexts in which we can talk about well definedness and what does it mean in each context?
 A: In simplest terms, $f:A \to B$ is well-defined if $x = y$ implies $f(x) = f(y)$. At first glance, this looks kind of ridiculous because we think of $x=y$ as meaning $x$ and $y$ are exactly the same thing, but that is not really how $=$ is used. 
For example we know that $\dfrac 13 = \dfrac 26.$

*
  
*The function $f:\mathbb Q \to \mathbb Z$ defined by 
      $f\left(\dfrac xy \right) = x+y$ is not well-defined
      because
      $f\left(\dfrac 13 \right) = 4$ and
      $f\left(\dfrac 26 \right) = 8.$
  
  
*
     The function $g:\mathbb Q \to \mathbb Z$ defined by 
     $g\left(\dfrac mn \right) = \sqrt[n]{(-1)^m}$
     is not well-defined because 
     $g\left(\dfrac 13 \right) = \sqrt[3]{(-1)^1}=-1$ and
     $g\left(\dfrac 26 \right) = \sqrt[6]{(-1)^2}=1.$
  
 
This is important. A function that is not well-defined, is actually not even a function.
An example of a function that is well-defined  would be the function
$h:\mathbb Z_8 \to \mathbb Z_{12}$ defined by $h(\bar x) = \overline{3x}$. We can reason that
\begin{align}
  \bar x = \bar y \text{ (In $\mathbb Z_8$) }
  &\implies  x \equiv y \pmod 8\\
  &\implies 3x \equiv 3y \pmod{24}\\
  &\implies 3x \equiv 3y \pmod{12}\\
  &\implies \overline{3x} = \overline{3y} \text{ (In $\mathbb Z_{12}$)}\\
  &\implies h(\bar x) = h(\bar y) \text{ (In $\mathbb Z_{12}$).}
\end{align}
Hence $h$ is a well-defined function.
A: The term well-defined (as oppsed to simply defined) is typically used when a definition seemingly depends on a choice, but in the end does not.
In most (but not all) cases, this applies to the definition of a function $f\colon A\to B$ in terms of two given functions $g\colon C\to A$ and $h\colon C\to B$: For $a\in A$ we want to define $f(a)$ by first picking an element $c\in C$ with $g(c)=a$ and then let $f(a)=h(c)$. Two problems arise with this: First of all, we must make sure that for each $a\in A$ there exists $c\in C$ with $g(c)=a$, in other words: $g$ must be surjective. But we also must make sure that the choice of $c$ is irrelevant, that is: Whenever $g(c)=g(c')$ it must also be true that $h(c)=h(c')$. Only if $g,h$ fulfil these conditions the above construction will actually define a function $f\colon A\to B$. To repeat: After this, $f$ is in fact defined. The definition itself does not become a "better" definition by saying that $f$ is well-defined. Instead, saying that $f$ is well-defined just states the (hopefully provable) fact that the conditions described above hold for $g,h$, and so we really have given a definition of $f$ this way. If the conditions don't hold, $f$ is not somehow "less well defined", it is not defined at all.
A: It might differ depending on the context, but I suppose it's in a context that you say something about the set, function or whatever and say that it's well defined.
For example:

Let $f(x)$ be a function defined on $\mathbb R^+$ such that $f(x)>0$ and $(f(x))^2=x$, then $f$ is well defined.

This means that the statement about $f$ can be taken as a definition, what it formally means is that there exists exactly one such function (and of course it's the square root). 
A: An example that I like is when one tries to define an application on a domain that is a "structure" described by "generators" by assigning a value to the generators and extending to the whole structure. Sometimes, because there are 
relationships between generators, the function is ill-defined (the opposite of well-defined). 
For a concrete example, the linear form $f$ on ${\mathbb R}^2$ defined by $f(1,0)=1$, $f(0,1)=-1$ and $f(-3,2)=0$ is ill-defined. As a less silly example, you encounter this kind of difficulty when defining application on a tensor products by assigning values on elementary tensors and extending by linearity, since elementary tensors only span a tensor product and are far from being a basis (way too huge family).
Abstract algebra is another instance where ill-defined objects arise: if $H$ is a subgroup of a group $(G,*)$, you may want to define an operation 
on the quotient $G/H$ by defining $[g]*[g']=[g*g']$. This is ill-defined when $H$ is not a normal subgroup since the result may depend on the choice of $g$ and $g'$.
A: There is an additional, very useful notion of well-definedness, that was not written (so far) in the other answers, and it is the notion of well-definedness in an equivalence class/quotient space.
Take an equivalence relation $E$ on a set $X$.
We can then form the quotient $X/E$ (set of all equivalence classes). 
Take another set $Y$, and a function $f:X\to Y$. If $f(x)=f(y)$ whenever $x$ and $y$ belong to the same equivalence class, then we say that $f$ is well-defined on $X/E$, which intuitively means that it depends only on the class. 
More rigorously, what happens is that in this case we can ("well") define a new function $f':X/E\to Y$, as $f'([x])=f(x)$.
As an example, take as $X$ the set of all convex polygons, and take as $E$ "having the same number of edges". The number of diagonals only depends on the number of edges, and so it is a well-defined function on $X/E$.
A: The statement '' well defined'' is used in many different contexts and, generally, it means that something is defined in a way that correspond to some given ''definition'' in the  specific context.
As a simple example: if  I say:

given the function $f(x)=\sqrt{x}=y$ such that $y^2=x$

this function is not well defined. A function is well defined only if we specify the domain and the codomain, and iff to any element in the domain correspons only one element in the codomain. 
So, $f(x)=\sqrt{x}$ is ''well defined'' if we specify, as an example, $f : [0,+\infty) \to \mathbb{R}$ (because in $\mathbb{R}$ the symbol $\sqrt{x}$ is, by definition the positive square root) , but, in the case $ f:\mathbb{R}\to \mathbb{C}$  it is not well defined since it can have two values for the same $x$, and becomes ''well defined'' only if we have some rule for chose one of these values ( e.g. the principal square root).
As another example: if I say:

consider the vector space $\mathbb{R}^n$ 

this is not a well defined space, if I not know what is the field over which the vector space is given. $\mathbb{R}^n$ over the field of reals is a vectot space of dimension $n$, but over the field of rational numbers it is a vector space of dimension uncountably infinite.
Also for sets the definition can gives some problems, and we can have sets that are not well defined if we does not specify the context. As an example consider the set 

$D=\{x \in \mathbb{R}: x \mbox{  is a definable number}\}$

Since the concept of ''definable  real number'' can be different in different models of $\mathbb{R}$, this set is well defined only if we specify what is the model we are using ( see: Definable real numbers)
Obviously, in many situation, the context is such that it is not necessary to specify all these aspect of the definition, and it is sufficient to say that the thing we are defining is '' well defined'' in such a context.
A: You may also encounter well-definedness in such context:
There are situations when we are more interested in object's properties then actual form. In such cases we say that we define an object axiomatically or by properties. After stating this kind of definition we have to be sure that there exist an object with such properties and that the object is unique (or unique up to some isomorphism, see tensor product, free group, product topology).
Example
Definition. The exterior derivative on $M$ is a $\mathbb{R}$ linear map $d:\Omega^*(M)\to\Omega^{*+1}(M)$ such that 


*

*$df$ is a differential of $f$

*$d^2=0$

*$d(\alpha\wedge\beta)=d\alpha\wedge\beta+(-1)^{|\alpha|}\alpha\wedge d\beta$


First one should see that we do not have explicite form of $d.$ There is only list of properties that $d$ ought to obey. Hence we should ask if there exist such function $d.$ We can check that indeed
$$(d\omega)(X_0,\dots,X_{k})=\sum_i(-1)^iX_i(\omega(X_0,\dots \hat X_i\dots X_{k}))+\sum_{i<j}(-1)^{i+j}\omega([X_i,X_j],X_0,\dots \hat X_i\dots \hat X_j\dots X_{k})$$
satisfies three properties above.
Secondly notice that I used "the" in the definition. So one should suspect that there is unique such operator $d.$ I.e if $d_1$ and $d_2$ have above properties then $d_1=d_2.$ It is also true. 
Hence $d$ is well defined!

If you know easier example of this kind, please write in comment.
A: It is widely used in constructions with equivalence classes and partitions.For example when H is a normal subgroup of the group G, we define multiplication  on G/H by aH.bH=abH and say that it is well-defined to mean that if xH=aH and yH=bH then abH=xyH.  
A: Let me give a simple example that I used last week in my lecture to pre-service teachers. We define $\pi$ to be the ratio of the circumference and the diameter of a circle. But how do we know that this does not depend on our choice of circle? In fact, Euclid proves that given two circles, this ratio is the same. Therefore this definition is well-defined, i.e., does not depend on a particular choice of circle.
A: Whenever a mathematical object is constructed there is need for convincing arguments that the construction isn't ambigouos. Sometimes this need is more visible and sometimes less.
