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?

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.
