$f(x) \equiv 1$ mod $(x-1)$ and $f(x) \equiv 0$ mod $(x-3)$ then is there any $f(x)$?
Let we have a general polynomial form as following$$f(x)=a_0+a_1x+\cdots +a_dx^d$$We know that for some polynomials $a(x)$ and $b(x)$ $$f(x)=1+(x-1)a(x)=b(x)(x-3)$$therefore $$f(1)=1\\f(3)=0$$ which leads to $$(1)\quad a_0+a_1+\cdots +a_d=1\\(2)\quad a_0+3a_1+\cdots +3^da_d=0$$by subtracting $(1)$ from $(2)$ we obtain $$2a_1+8a_2+\cdots +(3^d-1)a_d=-1$$which is impossible since the LHS is even and the RHS is odd, so such a polynomial doesn't exist
The second condition basically says that $3$ is a root. But then substitute $x=3$ into the first condition: $0=f(3)\equiv 1 \pmod 2$, a contradiction.
Since $f(x)\equiv f(n)\mod x-n$, the second condition says $f(3)=0$ and $f(x)=(x-3)g(x)$ for some $g(x)\in\mathbf Z[x]$. But then $\;f(1)=-2g(1)$ is even, contrary to the first condition $f(1)=1$.