Terry Tao's argument generalizes to show that $f$ must be an isometry whenever $X$ has dimension greater than 1 and $Y$ is strictly convex. We start by proving a series of lemmas:
Lemma 1: Let $x,y\in X$, and let $a,b\geq0$ be such that $a+b\geq\|x-y\|$ and $|a-b|\leq\|x-y\|$. Then there exists $z\in X$ such that $\|x-z\|=a$ and $\|y-z\|=b$.
Proof: Let $S=\{z:\|x-z\|=a\}$; this is connected since $\dim X>1$. Note that $S$ intersects the line between $x$ and $y$ twice; our hypotheses on $a$ and $b$ imply that at one of these points $\|y-z\|\leq b$ and at the other $\|y-z\|\geq b$. Since $z\mapsto \|y-z\|$ is continuous on $S$, there must be some $z\in S$ such that $\|y-z\|=b$.
Lemma 2: Suppose $f(0)=0$ and $x\in X$ is such that $\|x\|\in\mathbb{N}$. Then for all $n\in\mathbb{Z}$, $f(nx)=nf(x)$.
Proof: By strict convexity, any triangle in $Y$ for which the triangle inequality is an equality must lie on a line. Applying this to the triangle formed by $0$, $f(x)$, and $f(nx)$ yields the desired result.
Lemma 3: Suppose $\|x-z\|$ and $\|y-z\|$ are both integers and $\|x-y\|$ is rational. Then $\|f(x)-f(y)\|=\|x-y\|$.
Proof: By translating, we may assume $z=0$ and $f(z)=0$. By Lemma 2, for all $n\in\mathbb{Z}$, $f(nx)=nf(x)$ and $f(ny)=nf(y)$. Letting $n$ be the denominator of $\|x-y\|$, we have $\|f(nx)-f(ny)\|=\|nx-ny\|$ since this is an integer, and the result follows by dividing by $n$.
Lemma 4: Suppose $\|x-y\|$ is rational. Then $\|f(x)-f(y)\|=\|x-y\|$.
Proof: Use Lemma 1 to find $z$ such that $\|x-z\|=\|y-z\|$ is some large integer and apply Lemma 3.
We now prove that $f$ is an isometry. Fix $x,y\in X$. Use Lemma 1 to find $z$ such that $\|x-z\|$ is small and rational and $\|y-z\|$ is rational and close to $\|x-y\|$. By Lemma 4 and the triangle inequality it follows that $\|f(x)-f(y)\|$ must be (arbitrarily) close to $\|x-y\|$.