Is $K' = \{ w \in \{0,1\}^* | M_w$ Halts on $w \}$, where $M_w$ is the TM whose encoding is $w$, equivalent to the halting problem? My professor presented the halting problem as $K' = \{ w \in \{0, 1\}^* | M_w$ Halts on $w \}$, where $M_w$ is the TM whose encoding is $w$ (i.e. $w = \langle M \rangle$), and said it was equivalent to $K = \{ \langle M,v \rangle | M $ Halts on $v \}$.

I tried to think it through and this is my understanding so far:

$(1)$ If $w \in K'$ then we can define $f(w)= \langle M_w,w \rangle$ then $w \in K' \Leftrightarrow  f(w) \in K$ so we have that $K'$ can be reduced to $K$

$(2)$ And for the other way around, we define $g(\langle M,v \rangle) = \langle M' \rangle$ where $M'$ is the TM that simulates the TM $M$ on input $v$ and halts iif $M$ halts on that input. So we get that both languages are reducible to each other thus equivalent.

But I'm not sure about part $(2)$, is the reasoning correct? Can someone shed some light on my problem?
The two languages aren't equal. However both $K$ and $K'$ are undecidable. 

Proof:

We know that:
$K = \{ \langle M , v \rangle | M$ halts on $v$ }. Let us construct another language: $K'' = \{ \langle M , \langle M\rangle \rangle | M$ halts on $\langle M \rangle \}$. Note that $K'' \subset K$ because we replaced $v$ by $\langle M \rangle$ (encoding of $M$). Also note the similarity of $K'$ and  $K''$.

If you prove that $K'$ is undecidable, we can conclude that $K$ is undecidable.

You might have proved that $K'$ is undecidable.