Isomorphism of varieties via coordinate rings There is a result which I think is true but it's not written anywhere. Since I just began studying algebraic geometry, it's hard to figure out this by myself.
Let $K$ be a field, $X\subset\mathbb{A}^n_k$ and $Y\subset\mathbb{A}^m_k$ be affine varieties. Then consider a morphism $f:X\to Y$, such that $f(p) = (f_1(p),\ldots, f_m(p))$, with $f_i\in K[x_1,\ldots, x_n]$ for $i=1\ldots m$.
This morphism induces a homomorphism $\phi: K[Y]\to K[X]$ between the coordinate rings $K[X] = K[x_1,\ldots, x_n]/I(X)$ and $K[Y] = K[x_1,\ldots,x_m]/I(Y)$. It is defined by $\phi(y_i+I(Y)) = f_i+I(X)$. We can also go the reverse way and induce a morphism from this kind of homomorphism, in fact there is a bijection between these morphisms and homomorphisms.
It is possible to go a step further and define a map (which is also called a morphism) $\phi^*:Spec(K[X])\to Spec(K[Y])$ given by $\phi^*(P) = \phi^{-1}(P)$. We say that $\phi^*$ is induced by $\phi$.
From my reading, looks like $f$ is a isomorphism $\iff\phi$ is a isomorphism $\iff\phi^*$ is a isomorphism. I want to know if this is true. Also, it's said that obtaining $\phi^*$ from $\phi$ is a generalization of obtaining $\phi$ from $f$, how is that so?
ADD: some important definitions below.

Sorry if the doubts are dumb, I'm still trying to get the big picture. I feel a little lost, so I would appreciate simple explanations. Thank you.
 A: It's true that an algebraic map of Zariski-closed subsets of $K^n$ (this is not what "affine variety over $K$" means unless $K$ is algebraically closed) is an isomorphism iff the induced map on rings of functions is an isomorphism. The point is that an inverse map on rings of functions provides the components of an algebraic map which inverts the original map. 
Depending on what you mean by $\text{Spec }$, though, the last part of the equivalence does not hold. Let me assume for simplicity that $K$ is algebraically closed. Consider the map
$$\mathbb{A}^1 \ni t \mapsto (t^2, t^3) \in \mathbb{A}^2.$$
The image of this map is the variety $\{ y^2 = x^3 \}$, with ring of functions $K[x, y]/(y^2 - x^3)$. The induced map
$$K[x, y]/(y^2 - x^3) \ni f(x, y) \mapsto f(t^2, t^3) \in K[t]$$
on rings of functions is not an isomorphism because its image does not contain $t$. But the induced induced map on prime ideals is an isomorphism (of sets). 
From a differential-geometric point of view, the problem is that the map $t \mapsto (t^2, t^3)$ does not induce an isomorphism on Zariski tangent spaces at the origin; that is, it is neither an immersion nor a submersion at the origin. This discrepancy cannot be detected at the level of prime ideals, but it can be detected using a non-prime ideal, namely the ideal $(t^2)$.
If you haven't already, it would be good at this point to spend some time studying the Nullstellensatz. 
