I have this confusion if there are two states of a machine $p$ and $q$. Let $x$ be an input string such that length of $x = k$, $g$ be the output function and let $g(p,x)$ and $g(q,x)$ be the output when the input $x$ is applied at state $p$ and $q$.
How can I prove that
$p \overset{k}\equiv{} q \iff \forall x, |x|=k, g(p,x)=g(q,x)$
i.e state p is k equivalent to state q iff and only if the given condition above
My definition of k equivalence is $p \overset{k}\equiv{} q \iff \forall x,|x|\le k, g(p,x)=g(q,x)$