This Exercise 4.1. from the book Algebraic Geometry I, by Gortz.
Problem Let $R$ be a ring, and for every $R$-algebra $A$ let $\alpha_A:A\rightarrow A$ be a map of sets such that for every $R$-algebra homomorphism $\varphi: A\rightarrow A'$, one has $\varphi\circ\alpha_A=\alpha_{A'}\circ\varphi$. Prove that there exists a polynomial $P\in R[x]$ such that for every $A$ and every $a\in A$, $\alpha_A(a)=P(a)$ in two different ways: (i) Not using Yoneda Lemma and (ii) Using Yoneda Lemma.
Attempt at a solution:
This is not using Yoneda Lemma:
Let $A$ be any $R$-algebra, $\alpha_A:A\rightarrow A$ any set map. Let $\alpha_{A'}:A'\rightarrow A'$, where $A'=R[x]$ be a set map, given by $x\mapsto P(x)$.
My claim is that $\alpha_{A'}(x)$ is the desired polynomial. To see this, let $a\in A$ be any such element. Let, $\varphi: R[x]\to A$ by $x\mapsto a$, be an $R$-algebra homomorphism. Then, by hypothesis we have: $\varphi\circ \alpha_{A'}=\alpha_A\circ\varphi.$
So, $$\alpha_A(a)=\alpha_A(\varphi(x))=\varphi(\alpha_{A'}(x))=\alpha_{A'}(\varphi(x))=\alpha_{A'}(a)=P(a).$$
This seems really silly to me, and almost with no content. Did I make a silly mistake somewhere, or maybe I misinterpreted the problem completely?
Thanks in advance!!
Notice when you don't want to use the Yoneda Lemma, you actually repeat the proof of the Yoneda Lemma in a special case. Your proof is correct. And it has a content, namely that $x \in R[x]$ is the universal element of an $R$-algebra. Every element of an $R$-algebra "comes" from this $x$.