Lets say we have a 1 dimensional system with coordinate $x$ and the associated operator $\hat x$ with eigenstates $|x\rangle$. A function of $x$ is defined as $$ f(x) = \langle x |f\rangle \tag{1} $$ Now we introduce a new coordinate $y$ with operator $\hat y $ and corresponding eigenstates. x and y are describing the same 1 dimensional space. and both sets of eigenstates are assumed to be complete and orthogonal in the the sense of $$ \hat 1 = \int dx ~|x\rangle \langle x|\\ \langle x|x'\rangle = \delta(x-x').\tag{2} $$
The relationship between coordinates $x$ and $y$ is given by $$\begin{aligned}x(y) &= ay \\ y(x) &= a^{-1}x \end{aligned}\tag{3}$$ where $a$ is a real constant.
Due to completeness the function $f(x)$ can be expressed as
$$
f(x) = \int ^\infty_{-\infty}dy \langle x|y\rangle \langle y|f\rangle\tag{4}
$$
What is $\langle x|y\rangle$ in this case? What is the relationship of $|x\rangle$ and $|y\rangle$? How would all of this apply to an example function like $f(x)= x^2$?
Does the coordinate transformation define these relationships or do i need more definitions to answer these questions?
I tried the following $$ f(x(y)) = \tilde f(y) = a^2y^2 = \langle y|f\rangle\\ x^2 = \int ^\infty_{-\infty}dy \langle x|y\rangle a^2 y^2\\ \Rightarrow \langle x | y \rangle = a^{-2}\delta(x-y)\tag{5} $$ but that can't be right. The result depends on the function that i plug in, which shouldn't be the case. If had used a different $f(x)$ i would have gotten a different result for the matrix element $\langle x |y\rangle$. Where do i go wrong ?
My goal is to properly understand how a variable substitution, done in position representation, is expressed in Dirac Notation. Preferably starting in position representation and going "backwards" to Dirac Notation. I am uncertain how such a transformation is properly expressed in the more abstract Dirac representation or how it affects the states. I have no trouble doing a coordinate substitution in a integral of the form $$ \langle f|f\rangle = \int f^*(x)f(x) dx \tag{6} $$ for the right side of the equation which is given in position representation but i fail at doing the same in a more abstract manner.
The right side simply transforms to $$\begin{aligned} \int \langle f|x\rangle \langle x|f\rangle dx &= \int f^*(x(y))f(x(y)) dx(y)\\ ? &=\int f^*(y) f(y) |\frac{dx}{dy}| dy\\ \end{aligned}\tag{7}$$ On the other hand i can write the integral also as the following, using the completeness of $y$, $$\begin{aligned} \langle f | f \rangle &= \int \langle f | y \rangle \langle y | f \rangle dy \\ \end{aligned}\tag{8}$$ Now i set both equations expressed in $y$ equal, $$ \int f^*(y) f(y) |\frac{dx}{dy}| dy = \int \langle f | y \rangle \langle y | f \rangle dy\tag{9} $$ which leads me to a contradiction, under the assumption that $f(y)=\langle y | f \rangle = f(x(y))$. Is the error the assumption $$ f(y)=\langle y | f \rangle = f(x(y)) \tag{10} $$ or something else ?