First we need to understand what $\mathbb Z_{30}$ is. As your professor said $\mathbb Z_{30}=\{[0],[1],[2],\ldots,[29]\}$ is a set containing $30$ elements.
The formal definition of this set is as equivalence classes (the congruence classes) of an equivalence relation (the Congruence relation) on $\mathbb Z$. The elements of $\mathbb Z_{30}$ are actually sets.
The element $[i]\in\mathbb Z_{30}$ is the subset of $\mathbb Z$ containing all integers which leave remainder $i$ when they are divided by $30$. For example: $\{-120027,-57,3,33,63,370293\}\subseteq[3]$ since all elements of this set leave remainder $3$ when they are divided by $30$. The number $125\not\in[3]$ because the remainder of $125$ divided by $30$ is five and not three; therefore $125\in[5]$.
What is $[0]$? It is the subset of $\mathbb Z$ containing all integers with no remainder when they are divided by $30$ (i.e. they are divided evenly by $30$).
The elements of $\mathbb Z_{30}$ look like this:
\begin{split}
[0]&=\{\ldots,-60,-30,0,30,60,90,\ldots\},\\
[1]&=\{\ldots,-59,-29,1,31,61,91,\ldots\},\\
[2]&=\{\ldots,-58,-28,2,32,62,92,\ldots\},\\
\vdots \ & \hspace{19ex} \vdots\\
[29]&=\{\ldots,-31,-1,29,59,89,119,\ldots\}.\\
\end{split}
Sometimes we use different names for the same elements of $\mathbb Z_{30}$. For example $[1]=[31]=[-29]$ and in general $[i]=[k]\iff k\in[i]$ for all $0\leq i\leq29$.
In general $\mathbb Z_n=\{[0]_n,[1]_n,\ldots,[n-1]_n\}$ (when is necessary we use the subscripts to avoid confusion) is the set containing $n-1$ elements, each element being a subset of $\mathbb Z$. The element $[i]_n\in\mathbb Z_n$ is $$[i]_n=\{k\in\mathbb Z: \text{the remainder of $k$ when is divided by $n$ is $i$}\}=\{rn+i:r\in\mathbb Z\}.$$
Another example is $\mathbb Z_2=\{[0],[1]\}$ with $[0]$ being the subset of $\mathbb Z$ containing all integers divided evenly by $2$, i.e. all even integers and $[1]$ is the rest of $\mathbb Z$, the odd integers. Therefore
\begin{split}
[0]_2&=\{\ldots,-46,\ldots,-24,\ldots,-4,-2,0,2,4,\ldots,36,\ldots\},\\
[1]_2&=\{\ldots,-45,\ldots,-23,\ldots,-3,-1,1,3,5,\ldots,37,\ldots\}.
\end{split}
Now a function $f:\mathbb Z_n \longrightarrow \mathbb Z_m$ between these sets is a relation which takes as input an element (a set) $[i]_n\in\mathbb Z_n$ and give as output an element of $\mathbb Z_m$.
What does it mean "$f:\mathbb Z_n\longrightarrow\mathbb Z_n$ defined as f([a])=[3a]"? It means $f$ maps the set represented by $[a]$ to the set represented by $[3a]$.
When we ask if such $f:\mathbb Z_n \longrightarrow \mathbb Z_m$ is well defined actually we ask: If we take different representatives $[a],[b]$ of the same set, then $f([a])=f([b])$? Since $[a]=[b]$ is the same thing then for $f$ to be well defined (to be function) we must have $f([a])=f([b])$.
Here are some examples of well defined and not well defined functions.
- $f:\mathbb Z_n \longrightarrow \mathbb Z_n$ with $f([a])=[a]$.
Is well defined because if $[a]=[b]\in\mathbb Z_n$ then $f([a])=[a]=[b]=f([b])$.
- $f:\mathbb Z_2 \longrightarrow \mathbb Z_2$ defined as follows $f([a])=[x]$ where $x=r+1$ with $r$ the last digit of $a$.
So $ \ f([34])=[5], \ f([-13])=[4], \ f([-1])=[2]$ etc. Is $f$ well defined? Lets see. The set $\mathbb Z_2$ contains $2$ elements $[0]$ and $[1]$. If $[a]=[b]$ then we have two possibilities. Either $[a]=[b]=[0]$, so $a,b$ are both even, or $[a]=[b]=[1]$ and $a,b$ are both odd integers. If $a,b$ are even then their last digit is one of $\{0,2,4,6,8\}$, therefore if $f([a])=[x]$ and $f([b])=[y]$ then $x,y\in\{1,3,5,7,9\}$ so $[x]=[y]=[1]$. Equivalently $f([a])=f([b])=[1]$. In a similar way if $a,b$ are odd $f([a])=f([b])=[0]$.
It follows that $f$ is well defined.
- $f:\mathbb Z_3 \longrightarrow \mathbb Z_3$ defined as follows $f([a])=[x]$ where $x=r+1$ with $r$ the last digit of $a$.
In this case $f$ is not well defined: $[1]=[13]$ and $f([1])=[2], \ f([13])=[4]\neq[2]$.
- $f:\mathbb Z_{47} \longrightarrow \mathbb Z_{47}$ defined as follows $f([a])=[3a]$.
Let's say that $[a]=[b]\in \mathbb Z_{47}$. This means that $a$ and $b$ leave the same remainder when they are divided by $47$. Therefore $a=47k+i$ and $b=47m+i$ for some $k,m\in\mathbb Z$ and $0\leq i\leq46$. We want to check whether $f([a])=f([b])$; equivalently whether $[3a]=[3b]$. Since $a=47\cdot3k+3i$ and $b=47\cdot3m+3i$ it follows that the remainder of $a$ divided by $47$ is the same as the remainder of $b$ divided by $47$. Both are the remainder of $3i$ divided by $47$. Therefore $f([a])=[3a]=[3b]=f([b])$ and $f$ is well defined.
- $f:\mathbb Z_{30} \longrightarrow \mathbb Z_{30}$ defined as follows $f([a])=[7a]$...