Consider the category of topological rings. By the Yoneda embedding, suppose $A$ is a topological ring, if the functor $\mathrm{Hom}(-,A)$ is given, then we can recover the topological ring $A$ from this functor $\mathrm{Hom}(-,A)$. My question is, how to determine the topology of $A$? I know how to recover the set structure of $A$, and the addition and multiplication law on it.
[EDIT] More precisely, as a set, $\mathrm{Hom}(\mathbb Z[X],A)$ is isomorphic to $A$, where $\mathbb Z[X]$ is with discrete topology. In this way we can recover the set structure of $A$. My question is how to determine the topology of $\mathrm{Hom}(\mathbb Z[X],A)$ only using the information of the functor $\mathrm{Hom}(-,A)$, such that the natural map $A\to\mathrm{Hom}(\mathbb Z[X],A)$, $a\mapsto(X\mapsto a)$ is a homeomorphism of topological spaces?
@crystalline said that we can consider the compact-open (?) topology on $\mathrm{Hom}(\mathbb Z[X],A)$, yes it recovers the topology on $A$, but I'm not satisfied with this answer, because if we give the compact-open topology to $\mathrm{Hom}$ sets, then for $A\to B$ a continuous ring homomorphism, I think in general the induced maps $\mathrm{Hom}(B,R)\to\mathrm{Hom(A,R)}$ and $\mathrm{Hom}(R,A)\to\mathrm{Hom}(R,B)$ are not continuous.
[EDIT2] All $\mathrm{Hom}$ here are continuous ring homomorphism (i.e. the morphism in the category of topological rings). Sorry for the confusion.
There is always a trivial way to recover the topology from $\operatorname{Hom}(-,A)$: it is the finest topology that makes every element of $\operatorname{Hom}(B,A)$ continuous for every topological ring $B$ (to prove this, take $B=A$ and consider the identity map). Of course, this is rather unsatisfying because it requires us to already know about the topology on all possible $B$s that we might plug into the functor (including $A$ itself!). Ideally, we would like to have a single $B$ (or some small number of $B$s) which we can understand easily and use to recover the topology of $A$.
Unfortunately, this is not possible. More precisely, there is no small subcategory $C$ of the category of topological rings such that the topology on a topological ring $A$ is determined by the restriction of the functor $\operatorname{Hom}(-,A)$ to $C$.
Here is a sketch of a proof. Fix a regular cardinal $\kappa$ and consider two topologies on the ordinal $\kappa+1$. The first topology, which gives a space I will call $X$, is the usual order topology. The second topology, which gives a space I will call $Y$, is the refinement of the order topology obtained by declaring $\{\kappa\}$ to be open. Note that both $X$ and $Y$ are locally compact Hausdorff, and the identity map $i:Y\to X$ is continuous. Furthermore, $i$ is a homeomorphism when restricted to any subset of cardinality $<\kappa$ (this follows from the regularity of $\kappa$).
We can take the free topological rings $F(X)$ and $F(Y)$ on $X$ and $Y$; the topology on these spaces turns out to be not too hard to understand because $X$ and $Y$ are locally compact Hausdorff (namely, they are just colimits of finite powers of $X$ and $Y$ representing all possible formal sums and products of elements). Now we have an induced continuous bijective homomorphism $F(i):F(Y)\to F(X)$, whose inverse is not continuous. However, $F(i)$ is a homeomorphism onto its image when restricted to any subset of $F(Y)$ of cardinality $<\kappa$, since $i$ is, and any subset of $F(Y)$ of cardinality $<\kappa$ involves fewer than $\kappa$ elements of $Y$. It follows that for any topological ring $B$ of cardinality $<\kappa$, a homomorphism $f:B\to F(Y)$ is continuous iff $F(i)f$ is continuous. That is, $F(i)$ induces an isomorphism between the functors $\operatorname{Hom}(-,F(Y))$ and $\operatorname{Hom}(-,F(X))$ when restricted to the subcategory of topological rings of cardinality $<\kappa$. Since $F(i)$ is not actually a homeomorphism, it follows that the topologies of $F(X)$ and $F(Y)$ cannot be recovered from the functor $\operatorname{Hom}(-,F(X))\cong \operatorname{Hom}(-,F(Y))$ restricted to topological rings of cardinality $<\kappa$.
That negative answer aside, here is the closest thing I can see to a positive answer. The topology on a space $A$ is determined by the convergence of ultrafilters on $A$ (or nets, or filters, if you prefer). Given an ultrafilter $U$ on $A$, consider the space $A_U=A\cup\{\infty\}$, topologized by saying every subset of $A$ is open and a set containing $\infty$ is open iff its intersection with $A$ is in $U$. Note that the space $A_U$ depends only on the underlying set of $A$, not the topology of $A$. The ultrafilter $U$ then converges to a point $x\in A$ iff the map $A_U\to A$ which is the identity on $A$ and sends $\infty$ to $x$ is continuous.
Now if $A$ is a topological ring, we can describe its convergent ultrafilters in terms of the functor $\operatorname{Hom}(-,A)$ as follows. An ultrafilter $U$ on $A$ converges to a point $x\in A$ iff the unique ring homomorphism $F(A_U)\to A$ from the free topological ring on $A_U$ to $A$ which is the identity on $A$ and sends $\infty$ to $x$ is in $\operatorname{Hom}(F(A_U),A)$. (This is a satisfying description because the topological ring $F(A_U)$ can be constructed from knowing only the underlying set of $A$, which can be described as the Hom-set $\operatorname{Hom}(\mathbb{Z}[X],A)$, and we can tell what an element of $\operatorname{Hom}(F(A_U),A)$ does on points by considering the induced map $\operatorname{Hom}(\mathbb{Z}[X],F(A_U))\to \operatorname{Hom}(\mathbb{Z}[X],A)$. The map $F(A_U)\to A$ which we're trying to realize depends only on the ring structure of $A$, which you say you already know how to recover.)
Of course, this description is probably not useful very often, since the topological rings $F(A_U)$ are not very easy to think about.